BUPT-homework/semester2/pset3/3-readFile.c

27 lines
385 B
C
Raw Normal View History

2022-04-03 23:22:03 +08:00
#include <stdio.h>
#include <strings.h>
#include <string.h>
int main(void) {
FILE *fp = fopen("dict.dic", "r");
int a;
char b[16]; // bool
2022-06-02 11:59:54 +08:00
char c[4096];
2022-04-03 23:22:03 +08:00
char d[4096];
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
2022-06-02 11:59:54 +08:00
fscanf(fp, "%i%s%s%s\n", &a, b, c, d);
2022-04-03 23:22:03 +08:00
}
printf("%i\n", a);
printf("%s\n", b);
2022-06-02 11:59:54 +08:00
printf("%s\n", c);
printf("%s", d);
2022-04-03 23:22:03 +08:00
return 0;
}