45 lines
951 B
C
45 lines
951 B
C
#include <stdio.h>
|
|
|
|
|
|
int main() {
|
|
char buf[1024];
|
|
char secret1[64];
|
|
char flag[64];
|
|
char secret2[64];
|
|
|
|
// Read in first secret menu item
|
|
FILE *fd = fopen("secret-menu-item-1.txt", "r");
|
|
if (fd == NULL){
|
|
printf("'secret-menu-item-1.txt' file not found, aborting.\n");
|
|
return 1;
|
|
}
|
|
fgets(secret1, 64, fd);
|
|
// Read in the flag
|
|
fd = fopen("flag.txt", "r");
|
|
if (fd == NULL){
|
|
printf("'flag.txt' file not found, aborting.\n");
|
|
return 1;
|
|
}
|
|
fgets(flag, 64, fd);
|
|
// Read in second secret menu item
|
|
fd = fopen("secret-menu-item-2.txt", "r");
|
|
if (fd == NULL){
|
|
printf("'secret-menu-item-2.txt' file not found, aborting.\n");
|
|
return 1;
|
|
}
|
|
fgets(secret2, 64, fd);
|
|
|
|
printf("Give me your order and I'll read it back to you:\n");
|
|
fflush(stdout);
|
|
scanf("%1024s", buf);
|
|
printf("Here's your order: ");
|
|
printf(buf);
|
|
printf("\n");
|
|
fflush(stdout);
|
|
|
|
printf("Bye!\n");
|
|
fflush(stdout);
|
|
|
|
return 0;
|
|
}
|