-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubjectnamesearch.cpp
More file actions
64 lines (54 loc) ยท 1.5 KB
/
subjectnamesearch.cpp
File metadata and controls
64 lines (54 loc) ยท 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <stdio.h>
#include <string.h>
#pragma warning (disable:4996)
#include "C:\Users\robby\Desktop\ciai03\ciai03.h"
#define N 20
/*typedef struct TimeTable {
char SubjectName[20];
char SubjectNum[11];
char Prof[10];
char DayOfWeek[5];
char RoomNum[6];
char Time[20]; //์
๋ ฅ ๋ฐ์ ๋, ํ์ ๋ช
์ (ex. HH:MM - HH:MM)
}TimeTable;*/
TimeTable info[N];
int i = 0;
void SubjectNameSearch(TimeTable info[N]) {
char Lecture[20];
strcpy(info[0].Time, "11:00-12:30");
strcpy(info[0].SubjectName, "์๋ฃ๊ตฌ์กฐ");
strcpy(info[1].SubjectName, "์๋ฃ๊ตฌ์กฐ");
strcpy(info[0].SubjectNum, "2150686201");
strcpy(info[1].SubjectNum, "2150686201");
strcpy(info[0].Prof, "๊น์ต์");
strcpy(info[0].DayOfWeek, "์");
strcpy(info[1].DayOfWeek, "๊ธ");
strcpy(info[0].RoomNum, "21302");
for (i = 0; i < N; i++) {
printf("๊ณผ๋ชฉ๋ช
์ ์
๋ ฅํ์ธ์ : (์ข
๋ฃํ๋ ค๋ฉด e, ๋ค๋ฅธ ๊ณผ๋ชฉ์ ์
๋ ฅํ์๋ ค๋ฉด m์ ์
๋ ฅํ์ธ์)\n");
scanf("%s", Lecture);
if (strcmp(Lecture, "e") == 0) {
break;
}
else if (strcmp(Lecture, info[i].SubjectName) == 0) {
printf("%s / %s / %s / %s / %s", info[i].SubjectName, info[i].DayOfWeek, info[i].Time, info[i].RoomNum, info[i].SubjectNum);
getchar();
i = 0;
break;
}
else if (strcmp(Lecture, "m") == 0) {
continue;
}
else {
printf("์ ์ ํ ๊ณผ๋ชฉ๋ช
, e, ๋๋ m์ ์
๋ ฅํ์ธ์\n");
continue;
}
}
getchar();
}
int main(void) {
SubjectNameSearch(info);
return 0;
}
//BuildingPrint(info,i);
//SimpleRoomPrint(info,i);