#include <stdio.h> main() { FILE *fp; if((fp=fopen("in.txt","rt"))==NULL) { printf("错误:文件不存在"); getch(); exit(1); } while(fscanf(fp,"%d",&a) != EOF ) { ...... } ......
时间: 2024-10-09 22:36:56
#include <stdio.h> main() { FILE *fp; if((fp=fopen("in.txt","rt"))==NULL) { printf("错误:文件不存在"); getch(); exit(1); } while(fscanf(fp,"%d",&a) != EOF ) { ...... } ......