while(1){ if (fscanf(fin,"%*lf %*lf %*lf %*lf %*lf %*lf")==EOF) break;fin= fopen("a.txt","r");if fin){printf("Can not open a.txt\n"); exit(0);}while(1){if (fscanf(fin,"%*lf %*lf %*lf")==EOF)break;NN++;}

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 12:23:59
while(1){ if (fscanf(fin,

while(1){ if (fscanf(fin,"%*lf %*lf %*lf %*lf %*lf %*lf")==EOF) break;fin= fopen("a.txt","r");if fin){printf("Can not open a.txt\n"); exit(0);}while(1){if (fscanf(fin,"%*lf %*lf %*lf")==EOF)break;NN++;}
while(1){ if (fscanf(fin,"%*lf %*lf %*lf %*lf %*lf %*lf")==EOF) break;
fin= fopen("a.txt","r");
if fin){
printf("Can not open a.txt\n"); exit(0);
}
while(1){
if (fscanf(fin,"%*lf %*lf %*lf")==EOF)break;
NN++;
}

while(1){ if (fscanf(fin,"%*lf %*lf %*lf %*lf %*lf %*lf")==EOF) break;fin= fopen("a.txt","r");if fin){printf("Can not open a.txt\n"); exit(0);}while(1){if (fscanf(fin,"%*lf %*lf %*lf")==EOF)break;NN++;}
以只读的形式,打卡a.txt文件, fscanf 返回读入数据的个数,否则返回 EOF.%f %F %g %G : 用来输入实数,可以用小数形式或指数形式输入.