//fgets fputs

FILE *fp;

char str[100];

fp = fopen("test.txt", "rt");

if (fp == NULL)

{

puts("文件读取失败\n");

exit(0);

}

while (fgets(str, 100, fp) != NULL)

{

printf("%s", str);

}

fclose(fp);