Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define N 1000
- int main () {
- int day[N], month[N], year[N],
- minBegin[N], hrBegin[N],
- minEnd[N], hrEnd[N];
- char cls[N][30], subject[N][100];
- char isStop = 'y';
- int i = 0;
- while (isStop != 'n' && isStop != 'N') {
- printf("\nPlease enter the class' info:\n");
- printf("Date: ");
- scanf("%d%*c%d%*c%d", &day[i], &month[i], &year[i]);
- while (getchar() != '\n');
- printf("Class name: ");
- scanf("%[^\n]", cls[i]);
- while (getchar() != '\n');
- printf("Subject name: ");
- scanf("%[^\n]", subject[i]);
- while (getchar() != '\n');
- printf("Begin time (e.g: 8:30): ");
- scanf("%d%*c%d", &minBegin[i], &hrBegin[i]);
- while (getchar() != '\n');
- printf("Finish time (e.g: 8:30): ");
- scanf("%d%*c%d", &minEnd[i], &hrEnd[i]);
- while (getchar() != '\n');
- printf("Do you want to continue? ([Y]es/[N]o) ");
- isStop = getchar();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement