全文预览

c语言上机练习100题

上传者:学习一点 |  格式:pdf  |  页数:186 |  大小:16219KB

文档介绍
ring.h>\r#include<conio.h>\rcharxx[20][80];\rvoidjsSort()\rvoidmain()\rreadDat();\rjsSort();\rwriteDat();\rreadDat()\r(\rFILE*in;\rinti=0;\rchar*p;\rin=fbpen(\in.dat\,\r);\rwhile(i<20&&fgets(xx[i],80,in)!=NULL){\rp=strchr(xx[i],,\n,);\rif(p)*p=O|\ri++|\r)\rfclose(in);\rwriteDat()\r{\rFILE*out;\rinti;\rclrscr();\rout=fbpen(\out.dat\,\w);\rfbr(i=0;i<20;i++){\rprint%'%s\n\,xx[i]);\rfprintf(out,\%s\n\,xx[i]);\r1EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rfclose(out);\r/*¾¤*/\rvoidjsSort()\r(\rintij,k,strl;\rcharch;\rfor(i=0|i<20;i++)\r(\rstrl=strlen(xx[i]);\rfbr(j=(strl+1)/2;j<strl\rfor(k=j+l;k<strl;k++)\rif(xx[i][j]>xx[i][k])\r(\rch=xx[i][j];\rxx[i]U]=xx[i][k];\rxx[i][k]=ch;\r}\rfor(j=0;j<strl/2;j++)\r(\rch=xx[i][j];\rxx[i][j]=xx[i][(strl+l)/2+j];\rxx[i][(strl+l)/2+j]=ch;\r1

收藏

分享

举报
下载此文档