#include main______ {float fun______ ; float ave,a[3]={4.5,2,4}; ave=fun______ ; printf(“ave=%5.2f”,ave); } float fun______ {int j; float aver=1; for (j=0;j<3;j++) aver=x[j]*aver; return______ ; } 运行结果为: _ave=36.00_
求二维数组中最大元素值及下标 #include main() { int a[3][4]={{1,2,3,4}, {9,8,7,6}, {-10,10,-5,2}}; int i,j,row=0,colum=0,max; max=a[0][0]; for(i=0;i<=2;i++) for(j=0;j<=3;j++) if(______ ) { max=a[i][j]; row=i; _colum=j;_ } printf("max=%d,row=%d, colum=%d\n",max,row,colum); }
文件复制 #include main______ { FILE *in, *out; char ch,infile[10],outfile[10]; scanf("%s",infile); scanf("%s",outfile); if ((in = _fopen(infile, "r")_)== NULL) { printf("Cannot open infile.\n"); exit______ ; } if ((out = fopen(outfile, "w"))== NULL) { printf("Cannot open outfile.\n"); exit______ ; } while (!feof______ ) fputc(fgetc______ , out); fclose______ ; _fclose______ ;_ }