소개글
네트워크 프로그랭 - C++을 이용한 엘리베이터 작동 구현
목차
없음
본문내용
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <math.h>
#include <time.h>
#include <conio.h>
#include <string.h>
#define ENTER 13 //키보드의 ENTER
#define MAX 25 //최대 정원
unsigned int tm_hour=0, tm_min=0, tm_sec=0, b, c, d, e, t, x, y, i, k, j, l, m, n;
unsigned int in_ct_1, out_ct_1, wait_ct_1, total_ct_1, tin_ct_1, in_ct_2, out_ct_2, wait_ct_2, total_ct_2, tin_ct_2, total_ct, cho, ran_1, ran_2, ran_3, ran_4, ran_5, el_p1, el_p2, count, power;
float sum_1, sum_2, avr_1, avr_2, f, g;
float w,v,u;
float r_1[1000], r_2[1000];
char s;
struct{
int tm_sec; /*초(0~59) */
int tm_min; /*분(0~59) */
int tm_hour; /*시간(0~23) */
} tm;
void color(WORD color) //색을 지정해주는 함수.
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
}
enum {
BLOCK, /* 0 : 검은색 */
DARK_BLUE, /* 1 : 어두운 파란색 */
DARK_GREEN, /* 2 : 어두운 초록색 */
DARK_SKY_BLUE, /* 3 : 어두운 하늘색 */
DARK_RED, /* 4 : 어두운 빨간색 */
DARK_VOILET, /* 5 : 어두운 보라색 */
DARK_YELLOW, /* 6 : 어두운 노랑색 */
GRAY, /* 7 : 회색 */
DARK_GRAY, /* 8 : 어두운 회색 */
BLUE, /* 9 : 파란색 */
GREEN, /* 10 : 초록색 */
SKY_BLUE, /* 11 : 하늘색 */
RED, /* 12 : 빨간색 */
VOILET, /* 13 : 보라색 */
YELLOW, /* 14 : 노란색 */
WHITE, /* 15 : 하얀색 */
};
void random_1() //손님 랜덤함수
{
srand(time(NULL));
ran_1 = rand()%15;
}
void random_2() //손님 랜덤함수
{
srand(time(NULL));
ran_2 = rand()%12;
}
void random_3() //손님 랜덤함수
{
srand(time(NULL));
ran_3 = rand()%15;
}
void random_4() //손님 랜덤함수
{
srand(time(NULL));
ran_4 = rand()%12;
}
참고 자료
없음