#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
//格式化
struct std {
char ch[64];
int age;
float source;
};
//int main() {
// struct std s = { "小何",15,96 };
// FILE* f = fopen("test3.txt", "w");
// if (f == NULL) {
// perror("fopen");
// return -1;
// }
// fprintf(f, "%s %d %f", s.ch, s.age, s.source);
// fclose(f);
// system("pause");
// return 0;
//}
int main() {
struct std s = {0};
FILE* f = fopen("test3.txt", "r");
if (f == NULL) {
perror("fopen");
return -1;
}
fscanf(f, "%s %d %f", s.ch, &(s.age), &(s.source));
printf("%s %d %f", s.ch, s.age, s.source);
fclose(f);
f = NULL;
system("pause");
return 0;
}