#include <stdio.h>#define N 11int main(){ int a[N]; int m,i; FILE *fp, *fpOut; fp=fopen("c\\data.txt","r"); fpOut=fopen("c\\result.txt","w"); for (i=0;i<11;i++) { fscanf (fp,"%d",&a[N]); } m=a[0]; for (i=0;i<11;i++) { m=m+a[i]; } fprintf(fpOut,"%d\n",m); fclose(fpOut); fclose(fp);}
- 2 回答
- 0 关注
- 1578 浏览
添加回答
举报
0/150
提交
取消