题目内容
请将代码补充完整。01 #include 02 #include 0304 int main()05 {06 int a=0,sum=0;07 FILE *fp;08 fp=fopen("int.txt","r");09 if()10 {11 printf("can not open file int.txt\n");12 exit(0);13 }14 while()15 {16 fscanf(fp,"%d",&a);17 sum+=a;18 }19 fclose(fp);20 fp=fopen("int.txt","a");21 if()22 {23 printf("can not open file int.txt\n");24 exit(0);25 }26 fprintf(fp,"%c",' ');27 fprintf(fp,"%d",sum);28 fclose(fp);29 return 0;30 }
查看答案
搜索结果不匹配?点我反馈