C

지하철 프로그램

1. 내용

1-1. 처음에 프로그램을 실행하면 메뉴가 나옴

1. 전철 노선도 보기

2. 환승역 조회

3. 전철역 조회

4. 전철 경로 안내

1-2. 사용자로부터 입력을 받으면 아래의 내용 수행

1. 전철 노선도 보기
입력 : N 노선
출력 : N 노선의 역 전체 출력
2. 환승역 조회
입력 : N 노선
출력 : N 노선의 환승역(환승 노선) 출력
3. 전철역 조회
입력 : 역 이름
출력 : **역은 N 노선의 M번째에 위치한 역입니다
4. 전철 경로 안내
입력 : 출발역 / 도착역
출력 : 출발역에서 도착역까지의 모든 역 출력(환승시 환승 정보 출력)

2. 조건

사용자 입력으로 0을 받으면 상단 메뉴로 이동, 첫 화면(전체 메뉴)에서 0을 입력받으면 종료

첨부된 make_cross.c, train.h를 이용하여 만들기


3. FloowChart

 

4. Source Code

4.1. make_cross.c

void make_cross_LINE1();
void make_cross_LINE2();
void make_cross_LINE3();
void make_cross_LINE4();
void make_cross_LINE5();
void make_cross_LINE6();
void make_cross_LINE7();
void make_cross_LINE8();
void make_cross_LINE9();
void make_cross_LINE1_1();
void make_cross_LINE2_1();
void make_cross_LINE2_2();
void make_cross_LINE5_1();
void make_cross_LINE_BUN();
void make_cross_LINE_I1();
void make_cross_LINE_I2();
void make_cross_LINE_GE();
void make_cross_LINE_KC();
void make_cross_LINE_AIR();
void make_cross_LINE_NEW();
void make_cross_LINE_YJ();
 
 
void make_cross()
{
    make_cross_LINE1();
    make_cross_LINE2();
    make_cross_LINE3();
    make_cross_LINE4();
    make_cross_LINE5();
    make_cross_LINE6();
    make_cross_LINE7();
    make_cross_LINE8();
    make_cross_LINE9();
    make_cross_LINE1_1();
    make_cross_LINE2_1();
    make_cross_LINE2_2();
    make_cross_LINE5_1();
    make_cross_LINE_BUN();
    make_cross_LINE_I1();
    make_cross_LINE_I2();
    make_cross_LINE_GE();
    make_cross_LINE_KC();
    make_cross_LINE_AIR();
    make_cross_LINE_NEW();
    make_cross_LINE_YJ();
}
 
void make_cross_LINE1()
{
    cross[LINE1 - 1][0][0] = 1;
    cross[LINE1 - 1][0][1] = LINE4;
    cross[LINE1 - 1][5][0] = 1;
    cross[LINE1 - 1][5][1] = LINE_I1;
    cross[LINE1 - 1][9][0] = 1;
    cross[LINE1 - 1][9][1] = LINE_I2;
    cross[LINE1 - 1][16][0] = 1;
    cross[LINE1 - 1][16][1] = LINE7;
    cross[LINE1 - 1][20][0] = 1;
    cross[LINE1 - 1][20][1] = LINE1_1;
    cross[LINE1 - 1][21][0] = 2;
    cross[LINE1 - 1][21][1] = LINE2;
    cross[LINE1 - 1][21][2] = LINE2_1;
    cross[LINE1 - 1][23][0] = 1;
    cross[LINE1 - 1][23][1] = LINE5;
    cross[LINE1 - 1][25][0] = 1;
    cross[LINE1 - 1][25][1] = LINE9;
    cross[LINE1 - 1][26][0] = 1;
    cross[LINE1 - 1][26][1] = LINE_GE;
    cross[LINE1 - 1][28][0] = 2;
    cross[LINE1 - 1][28][1] = LINE4;
    cross[LINE1 - 1][28][2] = LINE_AIR;
    cross[LINE1 - 1][29][0] = 1;
    cross[LINE1 - 1][29][1] = LINE2;
    cross[LINE1 - 1][31][0] = 2;
    cross[LINE1 - 1][31][1] = LINE3;
    cross[LINE1 - 1][31][2] = LINE5;
    cross[LINE1 - 1][33][0] = 1;
    cross[LINE1 - 1][33][1] = LINE4;
    cross[LINE1 - 1][34][0] = 1;
    cross[LINE1 - 1][34][1] = LINE5;
    cross[LINE1 - 1][35][0] = 1;
    cross[LINE1 - 1][35][1] = LINE2_2;
    cross[LINE1 - 1][37][0] = 1;
    cross[LINE1 - 1][37][1] = LINE_GE;
    cross[LINE1 - 1][38][0] = 1;
    cross[LINE1 - 1][38][1] = LINE_GE;
    cross[LINE1 - 1][41][0] = 1;
    cross[LINE1 - 1][41][1] = LINE6;
    cross[LINE1 - 1][42][0] = 1;
    cross[LINE1 - 1][42][1] = LINE_KC;
    cross[LINE1 - 1][45][0] = 1;
    cross[LINE1 - 1][45][1] = LINE4;
    cross[LINE1 - 1][48][0] = 1;
    cross[LINE1 - 1][48][1] = LINE7;    
}
 
void make_cross_LINE2()
{
    cross[LINE2 - 1][0][0] = 2;
    cross[LINE2 - 1][0][1] = LINE1;
    cross[LINE2 - 1][0][2] = LINE2_1;
    cross[LINE2 - 1][1][0] = 1;
    cross[LINE2 - 1][1][1] = LINE7;
    cross[LINE2 - 1][8][0] = 1;
    cross[LINE2 - 1][8][1] = LINE4;
    cross[LINE2 - 1][11][0] = 1;
    cross[LINE2 - 1][11][1] = LINE3;
    cross[LINE2 - 1][12][0] = 1;
    cross[LINE2 - 1][12][1] = LINE_NEW;
    cross[LINE2 - 1][14][0] = 1;
    cross[LINE2 - 1][14][1] = LINE_BUN;
    cross[LINE2 - 1][16][0] = 1;
    cross[LINE2 - 1][16][1] = LINE9;
    cross[LINE2 - 1][18][0] = 1;
    cross[LINE2 - 1][18][1] = LINE8;
    cross[LINE2 - 1][22][0] = 1;
    cross[LINE2 - 1][22][1] = LINE7;
    cross[LINE2 - 1][23][0] = 1;
    cross[LINE2 - 1][23][1] = LINE2_2;
    cross[LINE2 - 1][26][0] = 3;
    cross[LINE2 - 1][26][1] = LINE5;
    cross[LINE2 - 1][26][2] = LINE_BUN;
    cross[LINE2 - 1][26][3] = LINE_GE;
    cross[LINE2 - 1][28][0] = 1;
    cross[LINE2 - 1][28][1] = LINE6;
    cross[LINE2 - 1][29][0] = 2;
    cross[LINE2 - 1][29][1] = LINE4;
    cross[LINE2 - 1][29][2] = LINE5;
    cross[LINE2 - 1][30][0] = 1;
    cross[LINE2 - 1][30][1] = LINE5;
    cross[LINE2 - 1][31][0] = 1;
    cross[LINE2 - 1][31][1] = LINE3;
    cross[LINE2 - 1][33][0] = 1;
    cross[LINE2 - 1][33][1] = LINE1;
    cross[LINE2 - 1][34][0] = 1;
    cross[LINE2 - 1][34][1] = LINE5;
    cross[LINE2 - 1][38][0] = 2;
    cross[LINE2 - 1][38][1] = LINE_AIR;
    cross[LINE2 - 1][38][2] = LINE_GE;
    cross[LINE2 - 1][39][0] = 1;
    cross[LINE2 - 1][39][1] = LINE6;
    cross[LINE2 - 1][40][0] = 1;
    cross[LINE2 - 1][40][1] = LINE9;
    cross[LINE2 - 1][41][0] = 1;
    cross[LINE2 - 1][41][1] = LINE5;
}
 
void make_cross_LINE3()
{
    cross[LINE3 - 1][5][0] = 1;
    cross[LINE3 - 1][5][1] = LINE_GE;
    cross[LINE3 - 1][11][0] = 1;
    cross[LINE3 - 1][11][1] = LINE6;
    cross[LINE3 - 1][12][0] = 1;
    cross[LINE3 - 1][12][1] = LINE6;
    cross[LINE3 - 1][19][0] = 2;
    cross[LINE3 - 1][19][1] = LINE1;
    cross[LINE3 - 1][19][2] = LINE5;
    cross[LINE3 - 1][20][0] = 1;
    cross[LINE3 - 1][20][1] = LINE2;
    cross[LINE3 - 1][21][0] = 1;
    cross[LINE3 - 1][21][1] = LINE4;
    cross[LINE3 - 1][23][0] = 1;
    cross[LINE3 - 1][23][1] = LINE6;
    cross[LINE3 - 1][25][0] = 1;
    cross[LINE3 - 1][25][1] = LINE_GE;
    cross[LINE3 - 1][29][0] = 2;
    cross[LINE3 - 1][29][1] = LINE7;
    cross[LINE3 - 1][29][2] = LINE9;
    cross[LINE3 - 1][30][0] = 1;
    cross[LINE3 - 1][30][1] = LINE2;
    cross[LINE3 - 1][32][0] = 1;
    cross[LINE3 - 1][32][1] = LINE_NEW;
    cross[LINE3 - 1][34][0] = 1;
    cross[LINE3 - 1][34][1] = LINE_BUN;
    cross[LINE3 - 1][39][0] = 1;
    cross[LINE3 - 1][39][1] = LINE_BUN;
    cross[LINE3 - 1][40][0] = 1;
    cross[LINE3 - 1][40][1] = LINE8;
    cross[LINE3 - 1][42][0] = 1;
    cross[LINE3 - 1][42][1] = LINE5_1;
}
 
void make_cross_LINE4()
{
    cross[LINE4 - 1][0][0] = 1;
    cross[LINE4 - 1][0][1] = LINE1;
    cross[LINE4 - 1][6][0] = 1;
    cross[LINE4 - 1][6][1] = LINE_I1;
    cross[LINE4 - 1][25][0] = 1;
    cross[LINE4 - 1][25][1] = LINE1_1;
    cross[LINE4 - 1][35][0] = 1;
    cross[LINE4 - 1][35][1] = LINE2;
    cross[LINE4 - 1][36][0] = 1;
    cross[LINE4 - 1][36][1] = LINE7;
    cross[LINE4 - 1][37][0] = 1;
    cross[LINE4 - 1][37][1] = LINE9;
    cross[LINE4 - 1][38][0] = 1;
    cross[LINE4 - 1][38][1] = LINE_GE;
    cross[LINE4 - 1][40][0] = 1;
    cross[LINE4 - 1][40][1] = LINE6;
    cross[LINE4 - 1][42][0] = 1;
    cross[LINE4 - 1][42][1] = LINE1;
    cross[LINE4 - 1][45][0] = 1;
    cross[LINE4 - 1][45][1] = LINE3;
    cross[LINE4 - 1][46][0] = 2;
    cross[LINE4 - 1][46][1] = LINE2;
    cross[LINE4 - 1][46][2] = LINE5;
    cross[LINE4 - 1][47][0] = 1;
    cross[LINE4 - 1][47][1] = LINE1;
    cross[LINE4 - 1][56][0] = 1;
    cross[LINE4 - 1][56][1] = LINE1;
    cross[LINE4 - 1][57][0] = 1;
    cross[LINE4 - 1][57][1] = LINE7;
}
 
void make_cross_LINE5()
{
    cross[LINE5 - 1][2][0] = 2;
    cross[LINE5 - 1][2][1] = LINE9;
    cross[LINE5 - 1][2][2] = LINE_AIR;
    cross[LINE5 - 1][8][0] = 1;
    cross[LINE5 - 1][8][1] = LINE2_1;
    cross[LINE5 - 1][13][0] = 1;
    cross[LINE5 - 1][13][1] = LINE2;
    cross[LINE5 - 1][15][0] = 1;
    cross[LINE5 - 1][15][1] = LINE1;
    cross[LINE5 - 1][16][0] = 1;
    cross[LINE5 - 1][16][1] = LINE9;
    cross[LINE5 - 1][19][0] = 3;
    cross[LINE5 - 1][19][1] = LINE6;
    cross[LINE5 - 1][19][2] = LINE_AIR;
    cross[LINE5 - 1][19][3] = LINE_GE;
    cross[LINE5 - 1][21][0] = 1;
    cross[LINE5 - 1][21][1] = LINE2;
    cross[LINE5 - 1][24][0] = 2;
    cross[LINE5 - 1][24][1] = LINE1;
    cross[LINE5 - 1][24][2] = LINE3;
    cross[LINE5 - 1][25][0] = 1;
    cross[LINE5 - 1][25][1] = LINE2;
    cross[LINE5 - 1][26][0] = 1;
    cross[LINE5 - 1][26][1] = LINE2;
    cross[LINE5 - 1][26][2] = LINE4;
    cross[LINE5 - 1][27][0] = 1;
    cross[LINE5 - 1][27][1] = LINE6;
    cross[LINE5 - 1][30][0] = 2;
    cross[LINE5 - 1][30][1] = LINE_GE;
    cross[LINE5 - 1][30][2] = LINE2;
    cross[LINE5 - 1][34][0] = 1;
    cross[LINE5 - 1][34][1] = LINE7;
    cross[LINE5 - 1][37][0] = 1;
    cross[LINE5 - 1][37][1] = LINE8;
    cross[LINE5 - 1][38][0] = 1;
    cross[LINE5 - 1][38][1] = LINE5_1;
}
 
void make_cross_LINE6()
{
    cross[LINE6 - 1][1][0] = 1;
    cross[LINE6 - 1][1][1] = LINE3;
    cross[LINE6 - 1][3][0] = 1;
    cross[LINE6 - 1][3][1] = LINE3;
    cross[LINE6 - 1][8][0] = 2;
    cross[LINE6 - 1][8][1] = LINE_AIR;
    cross[LINE6 - 1][8][2] = LINE_GE;
    cross[LINE6 - 1][12][0] = 1;
    cross[LINE6 - 1][12][1] = LINE2;
    cross[LINE6 - 1][16][0] = 3;
    cross[LINE6 - 1][16][1] = LINE5;
    cross[LINE6 - 1][16][2] = LINE_AIR;
    cross[LINE6 - 1][16][3] = LINE_GE;
    cross[LINE6 - 1][17][0] = 1;
    cross[LINE6 - 1][17][1] = LINE_GE;
    cross[LINE6 - 1][18][0] = 1;
    cross[LINE6 - 1][18][1] = LINE4;
    cross[LINE6 - 1][23][0] = 1;
    cross[LINE6 - 1][23][1] = LINE3;
    cross[LINE6 - 1][24][0] = 1;
    cross[LINE6 - 1][24][1] = LINE5;
    cross[LINE6 - 1][25][0] = 1;
    cross[LINE6 - 1][25][1] = LINE2;
    cross[LINE6 - 1][26][0] = 1;
    cross[LINE6 - 1][26][1] = LINE1;
    cross[LINE6 - 1][34][0] = 1;
    cross[LINE6 - 1][34][1] = LINE1;
    cross[LINE6 - 1][35][0] = 1;
    cross[LINE6 - 1][35][1] = LINE7;
}
 
void make_cross_LINE7()
{
    cross[LINE7 - 1][0][0] = 1;
    cross[LINE7 - 1][0][1] = LINE_I1;
    cross[LINE7 - 1][9][0] = 1;
    cross[LINE7 - 1][9][1] = LINE1;
    cross[LINE7 - 1][13][0] = 1;
    cross[LINE7 - 1][13][1] = LINE1_1;
    cross[LINE7 - 1][15][0] = 1;
    cross[LINE7 - 1][15][1] = LINE2;
    cross[LINE7 - 1][23][0] = 1;
    cross[LINE7 - 1][23][1] = LINE4;
    cross[LINE7 - 1][25][0] = 1;
    cross[LINE7 - 1][25][1] = LINE9;
    cross[LINE7 - 1][29][0] = 1;
    cross[LINE7 - 1][29][1] = LINE_BUN;
    cross[LINE7 - 1][32][0] = 1;
    cross[LINE7 - 1][32][1] = LINE2;
    cross[LINE7 - 1][34][0] = 1;
    cross[LINE7 - 1][34][1] = LINE5;
    cross[LINE7 - 1][39][0] = 2;
    cross[LINE7 - 1][39][1] = LINE_GE;
    cross[LINE7 - 1][39][1] = LINE_KC;
    cross[LINE7 - 1][42][0] = 1;
    cross[LINE7 - 1][24][1] = LINE6;
    cross[LINE7 - 1][46][0] = 1;
    cross[LINE7 - 1][46][1] = LINE4;
    cross[LINE7 - 1][49][0] = 1;
    cross[LINE7 - 1][49][1] = LINE1;
}
 
void make_cross_LINE8()
{
    cross[LINE8 - 1][0][0] = 1;
    cross[LINE8 - 1][0][1] = LINE_BUN;
    cross[LINE8 - 1][6][0] = 1;
    cross[LINE8 - 1][6][1] = LINE_BUN;
    cross[LINE8 - 1][9][0] = 1;
    cross[LINE8 - 1][9][1] = LINE3;
    cross[LINE8 - 1][12][0] = 1;
    cross[LINE8 - 1][12][1] = LINE2;
    cross[LINE8 - 1][15][0] = 1;
    cross[LINE8 - 1][15][1] = LINE5;
}
 
void make_cross_LINE9()
{
    cross[LINE9 - 1][1][0] = 2;
    cross[LINE9 - 1][1][1] = LINE5;
    cross[LINE9 - 1][1][2] = LINE_AIR;
    cross[LINE9 - 1][11][0] = 1;
    cross[LINE9 - 1][11][1] = LINE2;
    cross[LINE9 - 1][13][0] = 1;
    cross[LINE9 - 1][13][1] = LINE5;
    cross[LINE9 - 1][15][0] = 1;
    cross[LINE9 - 1][15][1] = LINE1;
    cross[LINE9 - 1][18][0] = 1;
    cross[LINE9 - 1][18][1] = LINE4;
    cross[LINE9 - 1][21][0] = 2;
    cross[LINE9 - 1][21][1] = LINE3;
    cross[LINE9 - 1][21][2] = LINE7;
    cross[LINE9 - 1][25][0] = 1;
    cross[LINE9 - 1][25][1] = LINE_BUN;
    cross[LINE9 - 1][28][0] = 1;
    cross[LINE9 - 1][28][1] = LINE2;
}
 
void make_cross_LINE1_1()
{
    cross[LINE1_1 - 1][0][0] = 1;
    cross[LINE1_1 - 1][0][1] = LINE1;
    cross[LINE1_1 - 1][1][0] = 1;
    cross[LINE1_1 - 1][1][1] = LINE7;
    cross[LINE1_1 - 1][8][0] = 1;
    cross[LINE1_1 - 1][8][1] = LINE4;
    cross[LINE1_1 - 1][14][0] = 1;
    cross[LINE1_1 - 1][14][1] = LINE_BUN;
}
 
void make_cross_LINE2_1()
{
    cross[LINE2_1 - 1][0][0] = 1;
    cross[LINE2_1 - 1][0][1] = LINE5;
    cross[LINE2_1 - 1][4][0] = 1;
    cross[LINE2_1 - 1][4][1] = LINE2;
}
 
void make_cross_LINE2_2()
{
    cross[LINE2_2 - 1][0][0] = 1;
    cross[LINE2_2 - 1][0][1] = LINE2;
    cross[LINE2_2 - 1][4][0] = 1;
    cross[LINE2_2 - 1][4][1] = LINE1;
}
 
void make_cross_LINE5_1()
{
    cross[LINE5_1 - 1][0][0] = 1;
    cross[LINE5_1 - 1][0][1] = LINE5;
    cross[LINE5_1 - 1][4][0] = 1;
    cross[LINE5_1 - 1][4][1] = LINE3;
}
 
void make_cross_LINE_BUN()
{
    cross[LINE_BUN - 1][0][0] = 2;
    cross[LINE_BUN - 1][0][1] = LINE2;
    cross[LINE_BUN - 1][0][2] = LINE_GE;
    cross[LINE_BUN - 1][3][0] = 1;
    cross[LINE_BUN - 1][3][1] = LINE7;
    cross[LINE_BUN - 1][4][0] = 1;
    cross[LINE_BUN - 1][4][1] = LINE9;
    cross[LINE_BUN - 1][5][0] = 1;
    cross[LINE_BUN - 1][5][1] = LINE2;
    cross[LINE_BUN - 1][7][0] = 1;
    cross[LINE_BUN - 1][7][1] = LINE3;
    cross[LINE_BUN - 1][11][0] = 1;
    cross[LINE_BUN - 1][11][1] = LINE3;
    cross[LINE_BUN - 1][12][0] = 1;
    cross[LINE_BUN - 1][12][1] = LINE8;
    cross[LINE_BUN - 1][15][0] = 1;
    cross[LINE_BUN - 1][15][1] = LINE8;
    cross[LINE_BUN - 1][17][0] = 1;
    cross[LINE_BUN - 1][17][1] = LINE_YJ;
    cross[LINE_BUN - 1][20][0] = 1;
    cross[LINE_BUN - 1][20][1] = LINE_NEW;
    cross[LINE_BUN - 1][35][0] = 1;
    cross[LINE_BUN - 1][35][1] = LINE1_1;
}
 
void make_cross_LINE_I1()
{
    cross[LINE_I1 - 1][0][0] = 1;
    cross[LINE_I1 - 1][0][1] = LINE_AIR;
    cross[LINE_I1 - 1][8][0] = 1;
    cross[LINE_I1 - 1][8][1] = LINE7;
    cross[LINE_I1 - 1][10][0] = 1;
    cross[LINE_I1 - 1][10][1] = LINE1;
    cross[LINE_I1 - 1][14][0] = 1;
    cross[LINE_I1 - 1][14][1] = LINE_I2;
    cross[LINE_I1 - 1][20][0] = 1;
    cross[LINE_I1 - 1][20][1] = LINE4;
}
 
void make_cross_LINE_I2()
{
    cross[LINE_I2 - 1][6][0] = 1;
    cross[LINE_I2 - 1][6][1] = LINE_AIR;
    cross[LINE_I2 - 1][17][0] = 1;
    cross[LINE_I2 - 1][17][1] = LINE1;
    cross[LINE_I2 - 1][20][0] = 1;
    cross[LINE_I2 - 1][20][1] = LINE_I1;
}
 
void make_cross_LINE_GE()
{
    cross[LINE_GE - 1][12][0] = 1;
    cross[LINE_GE - 1][12][1] = LINE3;
    cross[LINE_GE - 1][17][0] = 2;
    cross[LINE_GE - 1][17][1] = LINE6;
    cross[LINE_GE - 1][17][2] = LINE_AIR;
    cross[LINE_GE - 1][19][0] = 2;
    cross[LINE_GE - 1][19][1] = LINE2;
    cross[LINE_GE - 1][19][1] = LINE_AIR;
    cross[LINE_GE - 1][21][0] = 3;
    cross[LINE_GE - 1][21][1] = LINE5;
    cross[LINE_GE - 1][21][2] = LINE6;
    cross[LINE_GE - 1][21][3] = LINE_AIR;
    cross[LINE_GE - 1][22][0] = 1;
    cross[LINE_GE - 1][22][1] = LINE6;
    cross[LINE_GE - 1][23][0] = 1;
    cross[LINE_GE - 1][23][1] = LINE1;
    cross[LINE_GE - 1][24][0] = 1;
    cross[LINE_GE - 1][24][1] = LINE4;
    cross[LINE_GE - 1][27][0] = 1;
    cross[LINE_GE - 1][27][1] = LINE3;
    cross[LINE_GE - 1][29][0] = 3;
    cross[LINE_GE - 1][29][1] = LINE2;
    cross[LINE_GE - 1][29][2] = LINE5;
    cross[LINE_GE - 1][29][3] = LINE_BUN;
    cross[LINE_GE - 1][30][0] = 1;
    cross[LINE_GE - 1][30][1] = LINE1;
    cross[LINE_GE - 1][31][0] = 1;
    cross[LINE_GE - 1][31][1] = LINE1;
    cross[LINE_GE - 1][33][0] = 2;
    cross[LINE_GE - 1][33][1] = LINE7;
    cross[LINE_GE - 1][33][2] = LINE_KC;
    cross[LINE_GE - 1][34][0] = 1;
    cross[LINE_GE - 1][34][1] = LINE_KC;
}
 
void make_cross_LINE_KC()
{
    cross[LINE_KC - 1][0][0] = 1;
    cross[LINE_KC - 1][0][1] = LINE1;
    cross[LINE_KC - 1][1][0] = 1;
    cross[LINE_KC - 1][1][1] = LINE_GE;
    cross[LINE_KC - 1][2][0] = 1;
    cross[LINE_KC - 1][2][1] = LINE_GE;
}
 
void make_cross_LINE_AIR()
{
    cross[LINE_AIR - 1][3][0] = 1;
    cross[LINE_AIR - 1][3][1] = LINE_I2;
    cross[LINE_AIR - 1][4][0] = 1;
    cross[LINE_AIR - 1][4][1] = LINE_I1;
    cross[LINE_AIR - 1][5][0] = 2;
    cross[LINE_AIR - 1][5][1] = LINE5;
    cross[LINE_AIR - 1][5][2] = LINE9;
    cross[LINE_AIR - 1][6][0] = 2;
    cross[LINE_AIR - 1][6][1] = LINE6;
    cross[LINE_AIR - 1][6][2] = LINE_GE;
    cross[LINE_AIR - 1][7][0] = 2;
    cross[LINE_AIR - 1][7][1] = LINE6;
    cross[LINE_AIR - 1][7][2] = LINE_GE;
    cross[LINE_AIR - 1][8][0] = 2;
    cross[LINE_AIR - 1][8][1] = LINE1;
    cross[LINE_AIR - 1][8][2] = LINE4;
}
 
void make_cross_LINE_NEW()
{
    cross[LINE_NEW - 1][0][0] = 1;
    cross[LINE_NEW - 1][0][1] = LINE2;
    cross[LINE_NEW - 1][1][0] = 1;
    cross[LINE_NEW - 1][1][1] = LINE3;
    cross[LINE_NEW - 1][4][0] = 1;
    cross[LINE_NEW - 1][4][1] = LINE_YJ;
    cross[LINE_NEW - 1][5][0] = 1;
    cross[LINE_NEW - 1][5][1] = LINE_BUN;
}
 
void make_cross_LINE_YJ()
{
    cross[LINE_YJ - 1][0][0] = 1;
    cross[LINE_YJ - 1][0][1] = LINE_NEW;
    cross[LINE_YJ - 1][1][0] = 1;
    cross[LINE_YJ - 1][1][1] = LINE_BUN;
 
}

4.2. train.h

#define    LINE_COUNT    21
#define    LINE_NAME    15
#define    TRAIN_COUNT    62
#define    TRAIN_NAME    30
#define    MAX_CROSS    5
#define    LINE1        1
#define    LINE2        2
#define    LINE3        3
#define    LINE4        4
#define    LINE5        5
#define    LINE6        6
#define    LINE7        7
#define    LINE8        8
#define    LINE9        9
#define    LINE1_1        10
#define    LINE2_1        11
#define    LINE2_2        12
#define    LINE5_1        13
#define    LINE_BUN    14
#define    LINE_I1        15
#define    LINE_I2        16
#define    LINE_GE        17
#define    LINE_KC        18
#define    LINE_AIR    19
#define    LINE_NEW    20
#define    LINE_YJ        21
 
 
int    count[LINE_COUNT] = { 62, 43, 43, 60, 44, 38, 51, 17, 29, 35, 5, 5, 8, 36, 29, 27, 51, 20, 10, 12, 11 };
 
char    line[LINE_COUNT][LINE_NAME] = {"1호선", "2호선", "3호선", "4호선", "5호선", "6호선", "7호선", "8호선", "9호선", "경인선", "2-1호선", "2-2호선", "5-1호선", "분당선", "인천1호선", "인천2호선", "경의선", "경춘선", "공항철도", "신분당선", "여주선"};
 
 
char    train[LINE_COUNT][TRAIN_COUNT][TRAIN_NAME] = {
            {"인천", "동인천", "도원", "제물포", "도화", "주안", "간석", "동암", "백운", "부평", "부개", "송내", "중동", "부천", "소사", "역곡", "온수", "오류동", "개봉", "구일", "구로", "신도림", "영등포", "신길", "대방", "노량진", "용산", "남영", "서울역", "시청", "종각", "종로3가", "종로5가", "동대문", "동묘앞", "신설동", "제기동", "청량리", "회기", "외대앞", "신이문", "석계", "광운대", "월계", "녹천", "창동", "방학", "도봉", "도봉산", "망월사", "회룡", "의정부", "가능", "녹양", "양주", "덕계", "덕정", "지행", "동두천중앙", "보산", "동두천", "소요산"},
            {"신도림", "대림", "구로디지탈단지", "신대방", "신림", "봉천", "서울대입구", "낙성대", "사당", "방배", "서초", "교대", "강남", "역삼", "선릉", "삼성", "종합운동장", "신천", "잠실", "잠실나루", "강변", "구의", "건대입구",  "성수", "뚝섬", "한양대", "왕십리", "상왕십리", "신당", "동대문역사문화공원", "을지로4가", "을지로3가", "을지로입구", "시청", "충정로", "아현", "이대", "신촌", "홍대입구", "합정", "당산", "영등포구청", "문래"},
            {"대화", "주엽", "정발산", "마두", "백석", "대곡", "화정", "원당", "삼송", "지축", "구파발", "연신내", "불광", "녹번", "홍제", "무악제", "독립문", "경복궁", "안국", "종로2가", "을지로3가", "충무로", "동대입구", "약수", "금호", "옥수", "압구정", "신사", "잠원", "고속터미널", "교대", "남부터미널", "양재", "매봉", "도곡", "대치", "학여울", "대청", "일원", "수서", "가락시장", "경찰병원", "오금"},
            {"인천", "신포", "숭의", "인하대", "송도", "연수", "원인재", "남동인더스파크", "호구포", "인천논현", "소래포구", "월곶", "오이도", "정왕", "신길온천", "안산", "공단", "고잔", "중앙", "한대앞", "상록수", "반월", "대야미", "수리산", "산본", "금정", "범계", "평촌", "인덕원", "정부과천청사", "과천", "대공원", "경마공원", "선바위", "남태령", "사당", "이수", "동작", "이촌", "신용산", "삼각지", "숙대입구", "서울역", "회현", "명동", "충무로", "동대문역사문화공원", "동대문", "혜화", "한성대입구", "성신여대입구", "길음", "미아삼거리", "미아", "수유", "쌍문", "창동", "노원", "상계", "당고개"},
            {"방화", "개화산", "김포공항", "송정", "마곡", "발산", "우장산", "화곡", "까치산", "신정", "목동", "오목교", "양평", "영등포구청", "영등포시장", "신길", "여의도", "여의나루", "마포", "공덕", "애오개", "충정로", "서대문", "광화문", "종로3가", "을지로3가", "동대문역사문화공원", "청구", "신금호", "행당", "왕십리", "마장", "답십리", "장한평", "군자", "아차산", "광나루", "천호", "강동", "길동", "굽은다리", "영일", "고덕", "상일동"},
            {"구산", "연신내", "독바위", "불광", "역촌", "응암", "새절", "증산", "디지털미디어시티", "월드컵경기장", "마포구정", "망원", "합정", "상수", "광흥창", "대흥", "공덕", "효창공원앞", "삼각지", "녹사평", "이태원", "한강진", "버티고개", "약수", "청구", "신당", "동묘앞", "창신", "보문", "안암", "고려대", "월곡", "상월곡", "돌곶이", "석계", "태를입구", "화랑대", "봉화산"},
            {"부평구청", "굴포천", "삼산체육관", "상동", "부천시청", "신중동", "춘의", "부천종합운동장", "까치울", "온수", "천왕", "광명사거리", "철산", "가산디지털단지", "남구로", "대림", "신풍", "보라매", "신대방사거리", "장승배기", "상도", "숭실대입구", "남성", "이수", "내방", "고속터미널", "반포", "논현", "학동", "강남구청", "청담", "뚝섬유원지", "건대입구", "어린이대공원", "군자", "중곡", "용마산", "사가정", "면목", "상봉", "중화", "먹골", "태릉입구", "공릉", "하계", "중계", "노원", "마들", "수락산", "도봉산", "장암"},
            {"모란", "수진", "신흥", "단대오거리", "남한산성입구", "산성", "복정", "장지", "문정", "가락시장", "송파", "석촌", "잠실", "몽촌토성", "강동구청", "천호", "암사"},
            {"개화", "김포공항", "공항시장", "신방화", "양천학교", "가양", "증미", "등촌", "염창", "신목동", "선유도", "당산", "국회의사당", "여의도", "샛강", "노량진", "노들", "흑석", "동작", "구반포", "신반포", "고속터미널", "사평", "신논현", "언주", "선정릉", "삼성중앙", "봉은사", "종합운동장"},
            {"구로", "가산디지털단지", "독산", "금천구청", "석수", "관악", "안양", "명학", "금정", "군포", "당정", "의왕", "성균관대", "화서", "수원", "세류", "병점", "세마", "오산대", "오산", "진위", "송탄", "서정리", "지제", "평택", "성환", "직산", "두정", "천안", "봉명", "쌍용", "아산", "배방", "온양온천", "신창"},
            {"까치산", "신정네거리", "양천구청", "도림천", "신도림"},
            {"성수", "용답", "신답", "영두", "신설동"},
            {"강동", "둔촌동", "올림픽공원", "방이", "오금", "계롱", "거여", "마천"},
            {"왕십리", "서울숲", "압구정로데오", "강남구청", "선정릉", "선릉", "한티", "도곡", "구룡", "개포동", "대모산입구", "수서", "복정", "경원대", "태평", "모란", "야탑", "이매", "서현", "수내", "정자", "미금", "오리", "죽전", "보정", "구성", "신갈", "기흥", "상갈", "창명", "영통", "망포", "매탄권선", "수원시청", "매교", "수원"},
            {"계양", "귤현", "박촌", "임학", "계산", "경인교대입구", "작전", "갈산", "부평구청", "부평시장", "부평", "동수", "부평삼거리", "간석오거리", "인천시청", "예술회관", "인천터미널", "문학경기장", "선학", "신연수", "원인재", "동춘", "동막", "캠퍼스타운", "테크노파크", "지식정보단지", "인천대입구", "센트럴파크", "국제업무지구"} ,
            {"검단오류", "왕길", "검단사거리", "마전", "완정", "독정", "검암", "검바위", "아시아드경기장", "서구청", "가정", "가정중앙시장", "석남", "서부여성회관", "인천가좌", "가재율", "주안국가산단", "주안", "시민공원", "석바위시장", "인천시청", "석천사거리", "모래내시장", "만수", "남동구청", "인천대공원", "운연"},
            {"문산", "파주", "월롱", "금촌", "금릉", "운정", "야당", "탄현", "일산", "풍산", "백마", "곡산", "대곡", "능곡", "행신", "화전", "수색", "디지털미디어시티", "가좌", "홍대입구", "서강대역", "공덕", "효창공원앞", "용산", "이촌", "서빙고", "한남", "옥수", "응봉", "왕십리", "청량리", "회기", "중랑", "상봉", "망우", "양원", "구리", "도농", "양정", "덕소", "도심", "팔당", "운길산", "양수", "신원", "국수", "아신", "오빈", "양평", "원덕", "용문"},
            {"광운대", "상봉", "망우", "갈매", "별내역", "퇴계원", "사릉", "금곡", "평내호평", "마석", "대성리", "청평", "상천", "가평", "굴봉산", "백양리", "강촌", "김유정", "남춘천", "춘천"},
            {"인천국제공항", "공항화물청사", "운서", "검암", "계양", "김포공항", "디지털미디어시티", "홍대입구", "공덕", "서울역"},
            {"강남", "양재", "양재시민의숲", "청계산입구", "판교", "정자", "동천", "수지구청", "성복", "상현", "광교중앙", "광교"},
            {"판교", "이매", "삼동", "경기광주", "초월", "곤지암", "신둔도예촌", "이천", "부발", "세종대왕릉", "여주"}
};
 
int cross[LINE_COUNT][TRAIN_COUNT][MAX_CROSS+1] = {0};

 

Back To Top