正在加载图片...
printf("\nThe result is %d\n",fun(m)); bky() void bky() { FILE *IN,*OUT; int s; int t; int o; IN=fopen("in.dat","r"); if (IN==NULL) { printf("Read FILE Error"); } OUT=fopen ("out.dat","w"); if(OUT==NULL) { printf("Write FILE Error"); } for(s=1;s<=5;s+) { fscanf (IN,"%d",&t) o=fun (t); fprintf(OUT,"%d\n",o); } fclose(IN); fclose(OUT); } 示例代码: int a=0,b=0; whi1e((k>=2)&&(b<10) {if(k%13=0)|(k%17=0) [a=a+k;b++;} k--; return a;printf("\nThe result is %d\n", fun(m)); bky(); } void bky() { FILE *IN,*OUT; int s ; int t; int o; IN=fopen("in.dat","r"); if(IN==NULL) { printf("Read FILE Error"); } OUT=fopen("out.dat","w"); if(OUT==NULL) { printf("Write FILE Error"); } for(s=1;s<=5;s++) { fscanf(IN,"%d",&t); o=fun(t); fprintf(OUT,"%d\n",o); } fclose(IN); fclose(OUT); } 示例代码: int a=0,b=0; while((k>=2)&&(b<10)) {if((k%13==0)||(k%17==0)) {a=a+k;b++;} k--; } return a;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有