#include <stdio.h>
main()
{
FILE *fp;
if((fp=fopen("in.txt","rt"))==NULL)
{
printf("错误:文件不存在");
getch();
exit(1);
}
while(fscanf(fp,"%d",&a) != EOF )
{
......
}
......
#include <stdio.h>
main()
{
FILE *fp;
if((fp=fopen("in.txt","rt"))==NULL)
{
printf("错误:文件不存在");
getch();
exit(1);
}
while(fscanf(fp,"%d",&a) != EOF )
{
......
}
......
转载于:https://www.cnblogs.com/bruce27/p/4556792.html