全文预览

C语言题库汇总

上传者:火锅鸡 |  格式:pdf  |  页数:58 |  大小:4033KB

文档介绍
createdwithSpire.PDFfor.NET.\rintfun(inta[M][M])\r/**********Program**********/\r/**********End**********/\rmain()\r(\rinta[M][M]={{1,3,5,7,9},{2,4,6,8,10},{2,3,4,5,6},{4,5,6,7,8},{1,3,4,5,6}};\rinty;\ry=fun(a);\rprintf(z/s=%d\nz?,y);\rwwjtO;\r}\rvoidwwjt()\r(\rFILE*IN,*OUT;\rintiIN[M][M],iOUT;\rinti,j;\rIN=fopen("in.dat","r");\rif(IN==NULL)\r{\rprintf("PleaseVerifyTheCurrerntDir..itMayBeChanged");\r)\rOUT=fopen(/zout.dat","w");\rif(OUT==NULL)\r(\rprintf("PleaseVerifyTheCurrentDir..itMayBeChanged");\r)\r{for(i=0;i<M;i++)\rfor(j=0;j<M;j++)\rfscanf(IN,[j]);\riOUT=fun(iIN);\rfprintf(OUT,z?%d\nz?,iOUT);\r)EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rfclose(IN);\rfclose(OUT);\r.-\rints=0;\rinti,j;\rfor(i=0;i<M;i++)\rs=s+a[i][i]+a[i][M-l-i];\rs=s-a[(M-l)/2][(M-l)/2];\rreturns;

收藏

分享

举报
下载此文档