《全国计算机等级考试三级C语言上机100题1》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
ᐰὃC100⚪ਮ⚪1ᑏᦪjsValue(intm,intk,intxx[D+,ᦪḄ./012ᜧ4ᦪm67☠mḄk9ᦪ:ᐭᦪ
1Pleaseentertwointegers:'*);scanf("d%d\&m,&n);num(m,n,xx);for(m=0;m 2n);readwriteDat();)voidreadwriteDat()(intm,n,xx[1000],i;FILE 3rf=fopen("in.dat,,,'+rn);wf=fopen(,'out.dat,\',w");for(i=0;i<10;i++){fscanf(rf/%d%du,&m,&n);num(m,n,xx);for(m=0;m)fclose(rf)fclose(wf);ਮ⚪2ᦪIᦻTIN.DATX:ᨵ200ᦪ+CᵨGᦪreadDatPᦪ:ᐭᦪ 4fclose(fp);voidmain()(inti;readDat();jsVal();printf("¡ᩩTḄᦪ=%d 5”,ent);for(i=0;i 6");writeDatO)writeDat()(FILE*fp;inti;fp=fopenC^ut.dat",nwu);fprintf(fp,"%d 7",ent);for(i=0;i 8,',b[i]);fclose(fp);ਭ⚪3ᦪReadDat()·¸¥ᦻTIN.DATXGH¹ºᦻᦻ»:ᐭᑮª¼ᦪ 9intReadDat(void);voidWriteDat(void);voidStrOR(void){inti,righto,j,s,k;chartem[80J;for(i=0;ifor(j=strlen(xx[i])-l;j>=O;j—){k=0;memset(tem,0,80);if(xx[ij[j]=='o,){righto=j;for(s=righto+1;stem[k++]=xx[i][s];for(s=0;sif(xx[i][s]!=o')tem[k++]=xx[i][s];strcpy(xx[i],tem);)elsecontinue;voidmain(){clrscr();if(ReadDat()){printf("ᦪIᦻTIN.DATâ/ᡭä! 10\007");return;)StrOR();WriteDat();)intReadDat(void){FILE*fp;inti=0;char*p;if((fp=fopenCIN.DAT"JT"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],' 11'); 12if(p)*p=0;i++;)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen("OUT5.DAT“+“w")for(i=0;i 13,',xx[ij);fprintf(fp,u%s 14n,xx[i]);)fclose(fp);ਭ⚪4ᦪReadDat·¸¥ᦻTIN.DATXGH¹ºᦻᦻ»:ᐭᑮª¼ᦪ 15intReadDat(void);voidWriteDat(void);voidStrOL(void){inti,j,k,s,m,strl;charstr[80];for(i=0;i 16\007”);return;)StrOU);WriteDat();intReadDat(void)1FILE*fp;inti=0;char*p;if((fp=fopen(,,IN.DAT,,,r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){ 17p=strchr(xx[i]An*);if(p)*p=O;i++)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen(nOUT6.DATu,wu);for(i=0;i 18”,xx[i]);fprintf(fp,H%s 19H,xx[i]);)fclose(fp);ਮ⚪5ᙠᦻTin.datXᨵ200íᦪ+6Øᦪᙳᙠ1000î9999ÐïᦪReadDat()GH200ᦪ:Èᑮᦪ 20for(i=0;i<199;i++)for(j=i+lj<200;j++)if(aafi]%1000>aa[j]%1000llaa[i]%1000==aa[j]%1000&&aa[i]for(i=0;i<10;i++)bb[i]=aa[i];)voidmain()(readDat();jsSort();writeDat();)readDat()(FILE*in;inti;in=fopen(,,in.datu,,,rM);for(i=0;i<200;i++)fscanf(in,n%d\&aa[i]);fclose(in);)writeDat()(FILE*out;inti;clrscr();out=fopen("out.dat,',,,wu);for(i=0;i<10;i++){printf(n%d,',bb[i]);fprintf(out,n%d 21H,bb[i]);)fclose(out);)ਮ⚪6ᙠᦻTin.datXᨵ200íᦪ+6Øᦪᙳᙠ1000î9999ÐïᦪReadDatGH200ᦪ:Èᑮᦪ 22ᦻTout.datXa1ᜐᳮô90125099601270258088ᜐᳮB50998088702560129012¬1YᑖZ[\®ùMlᦋnoᦪmainஹGᦪIᦪReadDatpQMᦪIᦪWriteDatḄᑁr#include#include#includeintaa[200],bb[10];voidjsSort()(inti,j,data;for(i=0;i<199;i-H-)for(j=i+lj<200;j++)if(aali]%1000aa|jJ){data=aa[i];aa[i]=aa[jl;aa[jl=data;}for(i=0;i<10;i++)bb[i]=aa[i];)voidmain()(readDat();jsSort();writeDat();systemCpause");)readDat()(FILE*in;inti;in=fopen("in.dat,,,',rn);for(i=0;i<200;i++)fscanf(in,H%d,M,&aa[i]);fclose(in);)writeDat()FILE*oul; 23inti;clrscr();out=fopen("out.dat",nwn);for(i=0;i<10;i++){printf(ni=%d,%d 24n,i+l,bb[i]);fprintf(outj%d 25",bb[i]);}fclose(out);)ਮ⚪7ᙠᦻTIN.DATX:ᨵ100úû├ýþÿ ├ᵫṹdm(4) me(10) ᓫdj() ᦪsi() je()ᑖᡂᐸ#$=ᓫ*ᦪ'()*+ᦪReadDat(),-./100├01ᐭ3᪀ᦪsell#56ᑴ+ᦪSortDat ᐸ89⌕;$ᢥṹ=ᜧᑮ@ABᑡ EṹFG ᑣᢥ=ᜧᑮ@ABᑡ ᨬJᑡ3KL1ᐭ3᪀ᦪsell# ᨬMNᵨ+ᦪWriteDatP3KQ*ᑮᦻSOUT6.DAT#ᑖTUV1ᙠᦻSprogl.c#5XᦋZ[+ᦪmainஹ-ᦪ]+ᦪReadDat^Q*ᦪ]+ᦪWriteDatḄᑁa#include#include#include#include#include#defineMAX100typedefstruct{chardm[5];/*ṹ*/char*/intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/*}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){intij;PROxy;for(i=0;i<99;i++)for(j=i+l;j 26if(strcmp(sell[i].dm,sell[j].dm) 27",seU[i].dm,sell[i].mc,sell[i].dj,selI[i].sl,sell[i].je);fprintf(fp,"%s%s%4d%5d%5d 28M,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp); 29ਭ⚪f8+ᦪReadDat()gh=ᦻSENGIN#-.ijkᦻᦻl 1ᐭᑮmᦪxx#c56ᑴ+ᦪencryptChar ᢥnoḄpᐵrsᦪxx#ḄᡠᨵABp L1ᐭᦪxxḄsvḄwx ᨬMNᵨ+ᦪWriteDatP3KxxQ*ᑮᦻSPS1.DAT#pᐵr$f(p)=p*llmod256(p,ᦪ#yiḄASCIIz f(p),'(M{ḄASCIIz) K'(Mf(p)z@}~}32ᡈᜧ}130,ᑣ ᔲᑣf(p)ᡠsvḄABp(#ᵨ) ᑖTUV1ᙠᦻSprogl.c#ᦪ]ᦻS1Ḅ,$BḄᙳ@}805XᦋZ[+ᦪmainஹ-ᦪ]+ᦪReadDat^Q*ᦪ]+ᦪWriteDatḄᑁa#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻlḄBᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,jcfor(i=0;i 30\007H);return;)encryptChar();WriteDat();intReadDat(void) 31FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(neng.in",nru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]^n,);if(p)*p=O;i++c)maxline=i;fclose(fp);return0;1voidWriteDat(void)(FILE*fp;inti;fp=fopen("ps1.dat"V'w");for(i=0;i 32”,xx[i]);fprintf(fp,H%s 33",xx[i]);)fclose(fp);ਭਮ⚪f9+ᦪReadDat()gh=ᦻSIN.DAT#-.ijkᦻᦻl1ᐭᑮmᦪxx# 56ᑴ+ᦪSortCharD(),ᐸ+ᦪḄ89,$Bᓫsᢥ=ᜧᑮ@ḄVABV VMḄ3KLᢥB{1ᐭmᦪxx# ᨬMNᵨ+ᦪwriteDalP3KxxQ*ᑮᦻSOUT2.DAT#$ᦻ$dAe,BfC.CCbbAA3K$fedCBA.bbCCAAᦪ]ᦻS1Ḅ,$BḄᙳ@}80 ᪗¡^¢ᑖTUV1ᙠᦻSprogl.c#5XᦋZ[+ᦪmainஹ-ᦪ]+ᦪReadDat^Q*ᦪ]+ᦪwriteDatḄᑁa#include#include 34#includecharxx[50]l80J;intmaxline=O;/*ᦻlḄBᦪ*/intReadDat(void);voidWriteDat(void);voidSortCharD(void){inti,j,k,strl;charch;for(i=0;i 35\007”);return;)SortCharD();WriteDatO;intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen("IN.DAT,,c,r,,))==NULL)return1;while(fgets(xx[i],8O,fp)!=NULL){p=strchr(xx[i]An')cif(p)*p=O;i++c 36maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(,'OUT2.DAT"c,wu);for(i=0;i 37",xx[i]);fprintf(fp,n%s 38",xx[i]);)fclose(fp);)ਭਮ⚪f10+ᦪReadDat()gh=ᦻSIN.DAT#-.ijkᦻᦻl1ᐭᑮmᦪxx# 56ᑴ+ᦪConvertCharA(),ᐸ+ᦪḄ89,$BᓫPm#Ḅᡠᨵ@ᑏ¥ᦋᑏᡂ¥Ḅ¦i¥ K,¥z,ᑣᦋᑏᡂ¥aᜧᑏ¥Lᜧᑏ¥ @ᑏ¥L@ᑏ¥ ᐸ§P¨ᜐᳮḄmLᢥB{1ᐭmᦪxx# ᨬMNᵨ+ᦪwriteDatP3KxxQ*ᑮᦻSOUT1.DAT#$ᦻ:Adb.Bcdzaabck.LLhj3K$Aec.Bdeabbcdl.LLikᦪ]ᦻS1Ḅ,$BḄᙳ@}80 ᪗¡^¢ᑖTUV1ᙠᦻSprogl.c#5XᦋZ[+ᦪmainஹ-ᦪ]+ᦪReadDat^Q*ᦪ]+ᦪwriteDatḄᑁa#include#include#includecharxx[50][80];intmaxline=0;/*ᦻlḄBᦪ*/intReadDat(void);voidWriteDat(void);voidConvertCharA(void) 39inti,j;for(i=0;i 40\007”);return;)ConvertCharA();WriteDat();IintReadDat(void)FILE*fp;inti=0;char*p;if<(fp=fopen("IN.DATV'r"))==NULL)return1;while(fgets(xx[i],8O,fp)!=NULL){p=strchr(xx[i]An*);if(p)*p=O;i++c)maxline=i;fclose(fp);return0;IvoidWriteDat(void)FILE*fp;inti;clrscr();fp=fopen(',OUTl.DATuc'wu);for(i=0;i 41printf(',%s 42,',xx[ij);fprintf(fp,n%s 43n,xx[i]);)fclose(fp);)ਮ⚪f11UVprogl.cḄ89,$Psm#Ḅᡠᨵ¥ᦋᑏᡂ¥Ḅ¦i¥ ¥zᦋᑏᡂ¥a⌕;ᜧᑏ¥Lᜧᑏ¥ @ᑏ¥L@ᑏ¥ ᐸçèᦋ5ὃê6ᑏ+ᦪchg(char*s)ghUV⌕; ᨬMNᵨ+ᦪreadwriteDAT()P3KQ*ᑮᦻSbeLout#$sm#ᨵḄᑁa$Mn.l23Zxy,ᑣNᵨ+ᦪM 3K$No.l23Ayz$ᑖTUV1ᙠᦻSprogl.cᦻS#5XᦋZ[+ᦪmain()^Q*ᦪ]+ᦪreadwriteDAT()Ḅᑁa#include#include#include#include#defineN81voidreadwriteDAT();voidchg(char*s){intI;for(I=0;I 44rf=fopen(nbcl.inn,"rn);wf=fopen("bcl.out" "w");for(i=0;i<50;i++){fscanf(rf,n%sn,a);chg(a);fprintf(wf,u%s 45M,a);)fclose(rf);fclose(wf);ਭਮ⚪f12¨ëᙠᦻSIN.DAT#1ᨵ100├ ├ᵫṹdmì4í meì10í,ᓫdjìí ᦪsiìí jeìíᑖᡂᐸ#$=ᓫ*ᦪ'()*+ᦪReadDat,-./100├01ᐭ3᪀ᦪsell#56ᑴ+ᦪSortDat ᐸ89⌕;$ᢥ=@ᑮᜧABᑡ EF~ ᑣᢥ=@ᑮᜧABᑡ ᨬJᑡ3KL1ᐭ3᪀ᦪsell# ᨬMNᵨ+ᦪWriteDat P3KQ*ᑮᦻSOUT5.DAT#ᑖTUV1ᙠᦻSprogl.c#5XᦋZ[+ᦪmainஹ-ᦪ]+ᦪReadDat^Q*ᦪ]+ᦪWriteDatḄᑁa#include#include#include#include#include#defineMAX100typedefstruct{chardm[5];/*ṹ*/charmc[ll];/*intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/**/}PRO;PROsell[MAX];voidReadDat ;voidWriteDat ;voidSortDat(){intijcPROxy; 46for(i=0;i<99;i++)for(j=i+1;j 47,,,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,'1%s%s%4d%5d%5d 48",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je); 49fclose(fp);⚪f13¨ëᙠᦻSIN.DAT#1ᨵ100├ ├ᵫṹdm(4) me(10) ᓫdj() ᦪsi() je()ᑖᡂᐸ#$=ᓫ*ᦪ'()*+ᦪReadDat,-./100├01ᐭ3᪀ᦪsell#56ᑴ+ᦪSortDat ᐸ89⌕;$ᢥṹ=@ᑮᜧABᑡ EṹF~ ᑣᢥ=ᜧᑮ@ABᑡ ᨬJᑡ3KL1ᐭ3᪀ᦪsell#,ᨬMNᵨ+ᦪWriteDatP3KQ*ᑮᦻSOUT9.DAT#ᑖTUV1ᙠᦻSprogl.c#5XᦋZ[+ᦪmainஹ-ᦪ]+ᦪReadDat^Q*ᦪ]+ᦪWrileDatḄᑁa#include#include#include#include#include#defineMAX100typedefstruct{chardm[5];/*ṹ*/char*/intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/**/}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+1;j<100;j++)if(strcmp(sell[i].dm,sell[j].dm)>Ollstrcmp(sell[i].dm,sellfj].dm)==O&&sell[i].je 50memset(sell,0,sizeof(sell));ReadDat();SortDat();WriteDat();)voidReadDat()(FILE*fp;charstr[8O],ch[ll];inti;fp=fopen(nIN.DATn,nrM);for(i=0;i<100;i++){fgets(str,8O,fp);memcpy(sell[i].dm,str,4);memcpy(sell[i].mc,str+4,10);memcpy(ch,str+14,4)cch[4]=0;sell[i].dj=atoi(ch);memcpy(ch,str+18,5);ch[5]=0;sell[i].sl=atoi(ch);sell[i].je=(long)sell[i].dj*sell[i].sl;)fclose(fp);)voidWriteDat()(FILE*fp;inti;fp=fopenC'OUT9.DATuc,w");for(i=0;i 51n,sell[i].dm,sell[i].mc,seil[i].dj,sell[i].sl,sell[i].je);fprintf(fp/'%s%s%4d%5d%5d 52",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਭਮ⚪f14¨ëᦪ]ᦻSIN.DAT#1ᨵ200îᦪ 0¨Nᵨ-+ᦪreadDatP/ïᦪ1ᐭᦪa# 5ὃê6ᑴi+ᦪjsVal(),ᐸ89,$ðñ=ᦪa#.*iîᦪ Kîᦪòóᜧ}îᦪMḄᦪôᦪ,ᦪ(îᦪMöᦪ ᑣ÷'), 53ᑣ÷'*öøùᩩSḄᦪent0P/ïîᦪᢥ=@ᑮᜧḄV1ᐭᦪb# ᨬMNᵨᑏ+ᦪwriteDat()P3Kentûᦪb#ᔠᩩSḄîᦪQ*ᑮOUT.DATᦻS#$ᑖTUV1ᙠᦻSprogl.c#UV#¨oýᦪ$a[200],b[200],¨oý$ent5XᦋZᦪ]ᦻSIN.DAT#ḄþÿᦪஹᦪmainஹᦪreadDatᑏᦪwriteDat()Ḅᑁ#include#defineMAX200inta[MAX],b[MAXJ,ent=0;voidjsVal()(inti,j,flag;for(i=0;i 54”,ent);for(i=0;i 55");writeDat();writeDat() 56FILE*fp;inti;fp=fopenC'out.dat","w");fprintf(fp,ent);for(i=0;i 57u,b[i]);fclose(fp);)ਭ⚪15ᦪᦻIN.DATᨵ200ᦪ!ᵨᦪreadDat#$%ᦪᐭᦪ'a(ὃ*+ᑴ-ᦪjsVal(),ᐸ/0123-ᦪḄᓟᦪ56Ḅ789:9;ᦪ56Ḅ7;ᦪ56Ḅ789:9ᓝᦪ56Ḅ7=>ᓝᦪ56Ḅ789:9ᦪ56Ḅ7?@ᦪ1ᏔᦪᑣCDEFᩩḄᦪent#$%ᦪᢥH8ᑮᜧḄKLᐭᦪ'bᨬN!ᵨᑏᦪwriteDat()#OPent=>ᦪ'bQᔠᩩḄᦪSEᑮOUT.DATᦻTU2VᑖXYLᙠᦻprogl.cYL[\ᦪ'2a[200],b[200],[\]^2ent(_ᦋaᦪᦻIN.DATḄbcᦪஹᦪmainஹᦪreadDat()ᑏᦪwriteDat()Ḅᑁ#include#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVaK){inti,j;intqw,bw,sw,gw;for(i=0;i 58fp=fopen("in.dat"T‘);for(i=0;i 59”,ent);for(i=0;i 60M);writeDatO)writeDat()(FILE*fp;inti;fp=fopen("out.dat",Hwu);fprintf(fp,"%d 61",ent);for(i=0;i 62",b[i]);fclose(fp);)ਭਮ⚪16ᦪReadDatghHᦻIN.DATi-jkᦻᦻlᐭᑮ5Qmᦪ'xx(+ᑴᦪStrCharJR(),ᐸᦪḄ/012=noᓫ#5Qmᡠᨵ5QḄASCII7rs4ᯠN#rsNḄ5QASCII7uv6@5QḄASCH7wᑮxḄ5Qyᐭ@5Qmz{Ḅ|6ᨬN#ᜐᳮḄ5Qmyᢥnxᐭ5Qmᦪ'xxᨬN!ᵨᦪwriteDat#OPxxSEᑮᦻOUT8.DAT@ᦪᦻḄ12nḄᙳ89805Q᪗QVᑖXYLᙠᦻprogl.c(_ᦋa:ᦪmainஹᦪᦪReadDatSEᦪᦪwriteDatḄᑁ#include#include#includecharxx[50][80];intmaxline=0;/*ᦻlḄnᦪ*/intReadDat(void); 63voidWriteDat(void);voidStrCharJR(){inti,j;for(i=0;i 64\007n);return;)StrCharJR();WriteDat();)intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen("IN.DAT","rn))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]An*)if(p)*p=O;i++;)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen("OUT8.DATV'wu);for(i=0;i 65printf("%s 66",xx[ij);fprintf(fp,"%s 67",xx[i]);)fclose(fp);)ਮ⚪17ᦪREADDAT()ghHᦻIN.DATi-jkᦻᦻlᐭᑮ5Qmᦪ'XX;(+ᑴᦪCHA(),ᐸᦪ/01noᓫ#5QmḄ-5QḄASCII7v5QḄASCH7wᑮ-5Q5QḄASCH7v5QḄASCH7,wᑮx5QF-ᜐᳮᑮᨬN5QᨬN-5QḄASCII7v@-5QḄASCII7wᑮᨬN-xḄ5QwᑮḄx5Qᑖ¡ᙠ@5Qmz{Ḅ|6ᨬN#ᜐᳮḄ5Qm⌮£Nᢥnxᐭ5Qmᦪ'XX,ᨬN!ᵨᦪWRITEDATO#OPXXSEᑮᦻ0UT9.DAT.@ᦪᦻḄ1:nḄᙳ89805Q᪗Q.TU2VᑖXYL¥E(_ᦋaᦪmainஹᦪᦪReadDatSEᦪᦪwriteDatḄᑁ#include#include#includecharxx[50][80];intmaxline=0;/*ᦻlḄnᦪ*/intReadDat(void);voidWriteDat(void);voidChA(void){inti,j;charch;for(i=0;i 68printf("ᦪᦻIN.DAT0ᡭ! 69\007”);return;)ChA();WriteDat();)intReadDal(void)(FILE*fp;inti=0;char*p;if((fp=fopenCIN.DAT",nrn))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],' 70');if(p)*p=0;i++)maxline=i;fclose(fp);return0;)voidWriteDat(void){FILE*fp;inti;clrscr();fp=fopen("OUT9.DAT““w“);for(i=0;i 71*',xx[i]);fprintf(fp,n%s 72",xx[i]);)fclose(fp);ਮ⚪18ᦪReadDatghHᦻENGINi-jkᦻᦻlᐭᑮ5Qmᦪ'xx(+ᑴᦪencryptChar(),ᢥ¥[Ḅ¦§ᐵ©zᦪ'xxḄᡠᨵ5Qªn¦§yᐭᦪ'xxḄz{Ḅ|6ᨬN!ᵨᦪWriteDat#OPxxSEᑮᦻPS10.DAT 73¦§ᐵ©2f(p)=p*llmod256(p1ᦪ'«-5QḄASCH7f(p)1D¬Nx5QḄASCII7)P@5QḄASCII71ᏔᦪᡈD¬Nf(p)789:932,ᑣ¯5Q],ᔲᑣ±f(p)ᡠz{Ḅ5Qªn¦§VᑖXYLᙠᦻprogl.c@ᦪᦻḄ12nḄᙳ89805Q(_ᦋaᦪmainஹᦪᦪReadDatSEᦪᦪWriteDat()Ḅᑁ#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻlḄnᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,j;for(i=0;i 74\007");return;)encryptChar();WriteDat();intReadDat(void)1FILE*fp;inti=0;unsignedchar*p;if((fp=fopen("eng.in","r,'))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){ 75p=strchr(xx[ij,, 76,);if(p)*p=O;i++maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen("ps10.dat",W);for(i=0;i 77”,xx[i]);fprintf(fp,n%s 78H,xx[i]);)fclose(fp);ਮ⚪19+ᑏ-ᦪfindStr(char*str,char*substr),¯ᦪCD-³o2Ḅ´5Qmᙠµ-5QmEhḄ¶ᦪ·Ꮇ[SᐭḄ5Qmo”asdasasdfgasdaszx67asdmklo",´5Qmo“as”ᦪº»716ᦪReadWriteghHᦻin.dati¼5Qm!ᵨᦪfindStr(),ᨬN#OPSEᑮᦻout.datTU2VᑖXYLᙠᦻprogl.c(_ᦋaᦪmain()ᐸ½ᦪḄbcᑁ¾ᙠᦪfindStr()Ḅ¿ÀÁᐭÂ+ᑏḄ3ÃÄÅ#include#include#includeintfindStr(char*str,char*substr){inti,j,lenl,len2,cnt=0Jlag;lenl=strlen(str);len2=strlen(substr);for(i=0;i 79if(flag==1)cnt++;)returnent;main()charstr[81],substr[3];intn;clrscr();printf("Sᐭ@5Qmgets(str);printf("Sᐭ´5Qm:");gets(substr);puts(str);puts(substr);n=findStr(str,substr);printf(,'n=%d 80n,n);ReadWrite();IReadWrite()charstr[81],substr[3],ch;intn,len,i=0;FILE*rf,*wf;rf=fopen(nin.datH,"r");wf=fopen("out.dat'\Mwn);while(i<25){fgets(str,80,rf);fgets(substr,10,rf)len=strlen(substr)-1;ch=substrflen];if(ch==* 81'IIch==Oxla)substr[len]=0;n=findStr(str,substr);fprintf(wf,H%d 82",n);i++)fclose(rf);fclose(wf); 83ਭ⚪20+ᑏᦪjsValue,½Ḅ/012ÆFibonacciᦪᑡᜧ9tḄᨬ8Ḅ-ᦪOPᵫᦪº»ᐸFibonacciᦪᑡF(n)Ḅ[\o2F(0)=0,F(l)=lF(n)=F(n-l)+F(n-2)ᨬN!ᵨᦪwriteDali50ᦪ3ᑖ¡wEOP?#OPSEᑮᦻoul.dat·2Ét=1000Êᦪ7o21597VᑖXYLᙠᦻprogl.c(_ᦋaᦪmainᑏᦪwriteDatḄᑁ#includeintjsValue(intt){intfO=O,fl=l,fn;fn=fO+fl;while(fn<=t){fO=fl;fl=fn;fn=fO+fl;)returnfn;main()(intn;n=1000;printf("n=%d,f=%d 84' 85,jsValue(n));writeDat();)writeDat()(FILE*in,*out;inti,n,s;in=fopen(uin.dat",,"r");out=fopen(',out.dat,\,,wu);for(i=0;i<50;i++){fscanf(in,u%dn,&n);s=jsValue(n);printf(,,%d 86",s); 87fprintf(out,n%d 88n,s);)fclose(in);fclose(out);)ਮ⚪21ËᑡYLprogl.cḄ/012ᑭᵨ=ËᡠÍḄÎᓫϧÐÑÆÐY2cos(x)-x=0Ḅ-g᪷Xn+l=cos(Xn)ϧÓÔË2পiXIÖ7o0.0(2)X0=X1,#X1Ḅ7×¥X0(3)Xl=cos(X0),ÆE-xḄXI(4)3X0-X1ḄØz7890.000001,nÓÔ(5),ᔲᑣnÓÔ(2)(5)ᡠÆXIÚ1ÐYcos(X)-X=0Ḅg᪷Ûoᦪ7º»(+ᑏᦪcountValueghYLḄ⌕ÆᨬN!ᵨᦪwriteDat#OPSEᑮᦻOUT17.DATVᑖXYL¥E(_ᦋaᦪmainSEᦪᦪwriteDatḄᑁ#include#include#includefloatcountValue(){floatx0,x1;x1=0.0;do{x0=xl;xl=cos(x0);}while(fabs(x0-xl)>=0.000001);returnx1;Imain()(clrscr();printf("g᪷=%&",countValue);printf(',%f 89',,cos(countValue())-countValue());writeDat();writeDatO 90FILE*wf;wf=fopen("OUT17.DAT"'wu);fprintf(wf,"²f 91”,countValue());fclose(wf);)ਭ⚪22(+ᑏᦪcountValueO,½Ḅ/012Æn=ᑁ(ᒹÀn)áÊ0â3ã7◀ḄᡠᨵæᯠᦪçḄèÐ᪷s,Ûoᦪ7º»ᨬNOPsSEᑮᦻoutdat·3no1000Êᦪ7{o2s=153.909064VᑖXYLᙠᦻprogl.c(_ᦋaᦪmain()SᐭSEᦪᦪprogReadWriteḄᑁ#include#include#includedoublecountValue(intn){inti;doubles=0.0;for(i=l;i 92",countValue(1000));progReadWrite();)progReadWrite()(FILE*fp,*wf;inti,n;floats;fp=fopen("in.dat,',,,rn);if(fp==NULL){ 93printf("ᦪᦻin.datᙠ!)return;)wf=fopen(nout.dat","w");for(i=0;i<10;i++){fscanf(fp,"%d 94u,&n);s=countValue(n);fprintf(wf,M%f 95H,s);)fclose(fp);fclose(wf);⚪23ᙠᦻin.datᨵN(ᦪ<200)gᦪᦪreaddati$Ngᦪᐭᦪ'xx(+ᑴᦪcalvalueᐸ/0⌕Æ21ஹÆE$NgᦪḄèᙳ7aver2ஹᑖ¡ÆE$NgᦪḄᦪVᑖçsumint=>8ᦪVᑖçsumdec,ᨬN!ᵨᦪwritedat()#ᡠÆḄOPSEᑮᦻout.datTU2VᑖXYL¥E(_ᦋaᦪmainஹᦪᦪreaddatSEᦪᦪwritedatḄᑁ#include#include#defineMAXNUM200floatxx[MAXNUM];intN=0;/*ᦻIN.DATᐳᨵêëgᦪ*/doubleaver=0.0;/*èᙳ7*/doublesumint=0.0;/*ᦪVᑖç*/doublesumdec=0.0;/*8ᦪVᑖç*/intReadDat(void);voidWriteDat(void);voidCalValue(void){inti;for(i=0;i 96aver/=N;voidmain(){inti;clrscr();for(i=0;i 97");return;)Calvalue();printf("ᦻIN.DATᐳᨵgᦪ%d 98”,N);printf("èᙳ7=%.21f 99”,aver);printf("ᦪVᑖç=%.21f 100”,sumint);printf("8ᦪVᑖç%.21f 101",sumdec);WriteDat();system(Hpausen);)intReadDat(void)(FILE*fp;inti=0;if<(fp=fopen("in.datn,'7"))==NULL)return1;while(!feof(fp)){fscanf(fp,n%d,",&xx[i++]);}fclose(fp);return0;)voidWriteDat(void)(FILE*fp;fp=fopen("OUT.DAT",“w”);fprintf(fp,,,%.21f 102%.21f 103%.21f 104n,aver,sumint,sumdec);fclose(fp); 105⚪24ËᑡYLprogl.cḄ/012ᙠᦪ(100ö999)øùQᔠᩩḄᦪ¶H8ᑮᜧᐭᦪ'½ú1ûᐰèÐᦪý1¼ᦪ5þá·144ஹ676ᑴᦪᩩḄᦪḄᦪᡠᑴḄᦪᨬᵨᦪwriteDat'()*+ᑮᦻout.dat23ᦋ56ᦪmain9ᑏᦪwriteDatḄᑁ<#includeintjsValue(intbb[J){inti,j,k=O;inthun,ten,data;for(i=10;i<32;i++)hum=j/100;ten=j%100/10;data=j%10;if(hum==tenllhum==datallten==data)bb[k++]=j;}returnk;main()(intb[20],num;num=jsValue(b);writeDat(num,b);)writeDat(intnum,intbf])(FILE*out;inti;out=fopen(,'out.dat,,,,'w");printf(,'%d 106, 107um);fprintf(out,n%d 108",num);for(i=0;i 109ᦪᡠᦻᦪtᢣᐸᔜᦪḄᦪ121,676,94249ᩩḄᦪm=ll,m2=121,m3=l331Ḇᦻᦪᑴᦪintsvalue(k>ngm),)tᦻᦪᑣᦪ1,{ᑣ0ᨬ'()*+ᑮᦻut.dat2uᑖrs+3ᦋ56ᦪmainḄᑁ<#includeintjsValue(longn){inti,strl,half;charxy[20];ltoa(n,xy,10);strl=strlen(xy);half=strl/2;for(i=0;i 110”,m,m*m,m*m*m);fprintf(out,"m=%41d,m*m=%61d,m*m*m=%81d)}fclose(out);system("pausen);ਭਮ⚪n26ᙠᦻIN.DAT2ᨵ(ᦪ200)ᦪḄᦪᦪReadDat()¡¢£ᦪxᐭᦪ¥xx2ᑴᦪCalValueᐸ⌕§u1ஹ§+£ᦻ2ᐳᨵª«ᦪtotNumk2ஹ§£¬ᦪ1®¯Ḅ°ᦪtᏔᦪḄᦪḄᦪtotCnt,²³ᩩḄ£¬ᦪ(´Ḅµ)Ḅ¶·¸ᙳµtotPjz,ᨬᵨᦪwriteDat'ᡠ§Ḅ()*+ᑮᦻOUT.DAT2ᑖrsᙠᦻprogl.c23ᦋ56ᦪmainஹ¡ᦪReadDat()9ᑏᦪwriteDatḄᑁ<#include 111#include#defineMAXNUM200intxx[MAXNUM];inttotNum=0;/*ᦻIN.DAT2ᐳᨵª«ᦪ*/inttotCnt=0;/*¹ᔠᩩḄᦪḄᦪ*/doubletotPjz=0.0;/*¸ᙳµ*/intReadDat(void);voidwriteDat(void);voidCalValue(void){inti,data;for(i=0;i 112")kreturn;)CalValue();printf("ᦻIN.DAT2ᐳᨵᦪ=%d 113",totNum);printf("¹ᔠᩩḄᦪḄᦪ=%d 114",totCnt);printf("¸ᙳµ=%.2f 115",totPjz);writeDat();)intReadDat(void)FILE*fp;inti=0; 116if((fp=fopen(HIN.DATn,MrH))==NULL)return1;while(!feof(fp)){fscanf(fp/'%d,",&xxli+4-J);)fclose(fp);return0;)voidwriteDat(void)(FILE*fp;fp=fopen(nOUT.DATn,nwn);fprintf(fp,,,%d 117%d 118%6.2f 119",totNum,totCnt,totPjz);fclose(fp);)⚪n27Àᦪ»ᦻin.dat2ᨵ300ᦪxᵨ¡ᦪReadDat'£¬ᦪᐭᦪ¥a2ᑴ-ᦪjsValueᐸtu§+ᓟᦪḄᦪÃÄᦪḄᦪÃᓝᦪᓃḄᦪÃᦪḄᦪᜧÈÉḄᦪent,Ê'ᡠᨵᩩḄᦪËÌᐭᦪ¥b2ᯠᦪ¥bḄᦪᢥÏÐᑮᜧḄÑsÒÓsᨬᵨᑏᦪwriteDat'()*+ᑮout.datᦻu9123,9-1 2 3>0,ᑣᦪᩩᐭᦪ¥b2,Õᦪcnt=cnt+l9812,9-8-1-2>0,ᑣᦪ¼ᩩÖᶍᑖrsᙠᦻprogl.c2rs2ØÙᦪ¥ua[300],b[300],ØÙÚÛuent3ᦋ56ᦪmainஹ¡ᦪReadDat9ᑏᦪwriteDatḄᑁ<#includeinta[300],b[300],cnt=0;jsValue(){inti,j,qw,bw,sw,gw;for(i=0;i<300;i++){qw=a[i]/1000;bw=a[i]/100%10;sw=a[i]%100/10;gw=a[i]%10;if(qw-bw-sw-gw>0)b[cnt++]=a[i];)for(i=0;i 120inti;readDat();jsValue();writeDat();printf(ncnt=%d 121u,cnt);for(i=0;i)readDat()(FILE*fp;inti;fp=fopen("in.dat' 122rn);for(i=0;i<300;i+4-)fscanf(fp,n%d,'\&ali]);fclose(fp);)writeDat()(FILE*fp;inti;fp=fopen(',out.datV'wn);fprintf(fp,H%d 123",cnt);for(i=0;i 124#include#defineMAX200intalMAXJ,b[MAX],ent=0;voidjsValQ{inti,j,thou,hun,ten,data,ab,cd;for(i=0;i<200;i+4-){thou=a[i]/1000;hun=a[i]%1000/100;ten=a[i]%100/10;data=a[i]%10;ab=10*thou+len;cd=10*data+hun;if((ab-cd)>=0&&(ab-cd)<=10&&ab%2==I&&cd%2==1&&ab>=10&&cd>=10)b[cnt++]=a[i];)for(i=0;i 125”,ent);for(i=0;i 126'');writeDat();)writeDat()(FILE*fp;inti;fp=fopenC'out.dat","w11);fprintf(fp,,,%d 1271',ent);for(i=0;i 128'\b[i]); 129fclose(fp);ਮ⚪n29ᦪ»ᦻIN.DAT2ᨵ200ᦪxᵨ¡ᦪreadDat'£¬ᦪᐭᦪ¥a2ὃ¯ᑴÝᦪjsVal(),ᐸtu'ᓟᦪ9ᓝᦪÞ°¥ᡂÝ°Ḅᓝᦪab(°äᦪḄᓝᦪtàᦪḄᓟᦪ°äᦪḄᦪtàᦪḄᓝᦪ)²³'ᦪ9Äᦪ¥ᡂáÝ°Ḅᓝᦪcd(°ᓝᦪḄᓝᦪtàᦪḄᦪ°ᓝᦪḄᦪtàᦪḄÄᦪ))°¥ᡂḄãäᦪab-cd>=10Õab-cd<=20ÕãᦪᙳtᏔᦪæçã°ᦪḄᓝᦪᙳ¼ÉᑣèᩩḄᦪᢥÏᜧᑮÐḄÑsᐭᦪ¥b2x⌕é¶ᩩḄᦪḄᦪcntoᨬmainᦪᵨᑏᦪwEeDal()'()ent²³ᦪ¥b2¹ᔠᩩḄᦪ*+ᑮOUT.DATᦻ2uᑖrsᙠᦻprogl.c2rs2ØÙᦪ¥:a[200],b[200],ØÙÚÛuent3ᦋ5ᦪ»ᦻIN.DAT2Ḅëìᦪ»ஹ6ᦪmainஹ¡ᦪreadDat9ᑏᦪwriteDat()Ḅᑁ<#include#defineMAX200inta[MAXl,b[MAX],ent=0;voidjsVaK){inti,j,qw,bw,sw,gw,ab,cd;for(i=0;i 130voidmain()(inti;readDat();jsVal();printf("ᩩḄᦪ=%d 131”,ent);for(i=0;i 132");writeDat();)writeDatO(HLE*fp;inti;fp=fopen("out.dat",nwu);fprintf(fp,,'%d 133,',ent);for(i=0;i 134",bfil);fclose(fp);ਮ⚪n30ᦪ»ᦻIN.DAT2ᨵ200ᦪxᵨ¡ᦪreadDat'£¬ᦪᐭᦪ¥a2ὃ¯ᑴÝᦪjsVal(),ᐸtuËÌÏᦪ¥a2¢+Ýᦪ)ᦪíîÐÈᦪ²ḄïᦪÕᦪtᏔᦪ(ᦪ²¼ïᦪᑣ¼ðé),ᑣðé+ᩩḄᦪentx'£¬ᦪᢥÏÐᑮᜧḄÑsᐭᦪ¥b2ᨬᵨᑏᦪwriteDat()'()ent²³ᦪ¥b2¹ᔠᩩḄᦪ*+ᑮOUT.DATᦻ2uᑖrsᙠᦻprogl.c2rs2ØÙᦪ¥:a[200],b[200],ØÙÚÛuent3ᦋ5ᦪ»ᦻIN.DAT2Ḅëìᦪ»ஹ6ᦪmainஹ¡ᦪreadDal9ᑏᦪwriteDat()Ḅᑁ<#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsVal(){intij,flag;for(i=0;i 135for(i=0;i 136”,ent);for(i=0;i 137");writeDat();writeDat()(FILE*fp;inti;fp=fopen("out.dat",nwu);fprintf(fp,"%d 138",ent);for(i=0;i 139u,bfi]);fclose(fp);)ਮ⚪n31ᙠᦻIN.DAT2ᨵ100®ò├ôõö÷®ò├ôõöᵫ®òùṹdm(¹û4)®òüme(¹û10)ᓫþdj(û)ᦪÛsi(û)ÿ je()ᑖᡂᐸ =ᓫ*ᦪᦪReadDat100├!"#$%ᐭ'᪀ᦪsell)*ᑴᦪSortDatO,ᐸ,-⌕/ᢥ 1ᜧᑮ456ᑡ9: ;<9ᑣᢥ>?@ṹ1ᜧᑮ456ᑡ9ᨬCᑡ'DE%ᐭ'᪀ᦪsell9ᨬFGᵨᦪWriteDatOI'DJᑮᦻLOUT4.DATᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmainஹᦪVᦪReadDatWJᦪVᦪWriteDatḄᑁZ 140#include#include#include#include#include#defineMAX100typedefstruct)chardm[5[;/*>?@ṹ*/charmc[ll];/*>?]^*/intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/* */}PRO;PROselllMAXJ;voidReadDat();voidWriteDat();voidSortDat(){intij;PROxy;for(i=0;i<99;i++)for(j=i+1;j<100;j++)if(sell[i].je<0){xy=sell[i];sell[i]=sellfj];sell[j]=xy;}voidmain()(memset(sell,0,sizeof(sell));ReadDat();SortDat();WriteDat();voidReadDat()(FILE*fp;charstr[80],ch[ll];inti;fp=fopen("IN.DATn_'r");for(i=0;i 141memcpy(sell[i].mc,str+4,10);memcpy(ch,str+l4,4)_ch[4]=0;sell[i].dj=atoi(ch);memcpy(ch,str+18,5);ch[5]=0;sell[i].sl=atoi(ch);sell[i].je=(long)sell[i].dj*sell[i].sl;)fclose(fp);)voidWriteDat(void)(FILE*fp;inti;fp=fopen(nOUT4.DATu_'wu);for(i=0;i 142",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,seU[i].je);fprintf(fp,H%s%s%4d%5d%5d 143",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);ਮ⚪b32cdᙠᦻLIN.DAT%ᨵ100>?├!"#9f>?├!"#ᵫ>?@ṹdmhij4kl9>?]^mehij10kl9ᓫdjhl9ᦪsihl9 jehlᑖᡂᐸ =ᓫ*ᦪᦪReadDat 100├!"#$%ᐭ'᪀ᦪsell)*ᑴᦪSortDat9ᐸ,-⌕/ᢥ>?]^1ᜧᑮ456ᑡ9:>?]^;m9ᑣᢥ 14ᑮᜧ56ᑡ9ᨬCᑡ'DE%ᐭ'᪀ᦪsellᨬFGᵨᦪWriteDatI'DJᑮᦻLOUT7.DATᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmainஹᦪVᦪReadDatWJᦪVᦪWriteDatḄᑁZ#include#include#include#include#include#defineMAX100typedefstruct{chardm[5];/*>?noṹ*/char>?]^p 144intdj;/*ᓫ*/intsi;/*ᦪqlongje;/* */}PRO;PROselllMAXJ;voidReadDat();voidWriteDat();voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+l;j<100;j++)if(strcmp(sell[i].mc,sell[j].mc) 145voidWriteDat()FILE*fp;inti;fp=fopen("OUT7.DAT",“w")_for(i=0;i<100;i++){printf(H%s%s%4d%5d%5d 146M,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,”rs%s%4d%5d%5d 147",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਭਮ⚪b33)*ᑴᦪReadDattu1ᦻLIN.DAT1000ᓝ5ᑴᦪᑮᦪxx_)*ᑴᦪComputeᑖwxxᏔᦪḄᦪeven,ᦪḄzᙳ|avel,ᏔᦪḄzᙳ|ave2}~totfcḄ|9ᨬFGᵨᦪWriteDat()I'DJᑮOUT.DATᦻLḄN2totfc=l/NE(xx[i]-ave2)i=lNqᏔᦪḄᦪ9xx[i]qᏔᦪ9ave2qᏔᦪḄzᙳ|ᦪVᦻL%Ḅf6%10ᦪ9$ᵨ⌹p◞(fᦪᙳᜧ4m2000)ᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmainWJᦪVᦪwriteDatḄᑁZ#include#include#include#defineMAX1000intxx[MAX],odd=0,even=0;doubleave1=0.0,ave2=0.0,totfc=0.0;voidWriteDat(void);intReadDat(void){inti;FILE*fp;if((fp=fopen(,,IN.DAT,,_,r"))==NULL)return1; 148for(i=0;i 149n);}fclose(fp);return0;)voidCompute(void){inti,yy[MAX];for(i=0;i 150”)_return;)Compute();printf(',OVEN=%d 151AVEl=%f 152AVER2=%f 153TOTFC=%f 154,,,even,avel,ave2,totfc);WriteDat();)voidWriteDat(void)(FILE*fp;inti; 155fp=fopen(',OUT.DATn,,,wn);fprintf(fp,',%d 156%f 157%f 158%f 159,',even,ave1,ave2,totfc);fclose(fp);⚪b34id102⚪/ᦪisPrimeᦪNOprogl.cḄ,-⌱100}1000ᑁᡠᨵkᦪiᓝkᦪiW10◀ᡠᦪា¢kᦪiḄᦪ(293)o$J£¤ᦪḄᦪent}~¤ᦪ|ḄWsum)ὃ¦*ᑏᦪcountValue()tuNO⌕/9ᨬFGᵨᦪwriteDAT()I'DentWsumJᑮᦻLbclO.out¨©ᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmain()WJᦪVᦪwriteDATḄᑁZ#includeintent,sum;intisPrime(intm)(inti;for(i=2;i 160”,ent);printf("ª«ᩩLᦪ|ḄW%d”,sum);writeDAT(); 161writeDAT()(FILE*fp;fp=fopenC'bclO.out1',"wn);fprintf(fp,"%d 162%d 163",ent,sum);fclose(fp);)ਭ⚪b35¯°ᦪḄ±²⚗Al=l,A2=l,}Fᔜ⚗ᐹᨵᐵ·An=An-2+2An-l(¨n-2n-Iq᪗)¹ᑡNOprogl.cḄ,-⌕/º»¼ᦪM=100,1000W10000/¼½Ḅn|9¾ᐸª«Sn=M,¿Sn=Al+A2+...+An,$º»In|%ᐭᦪᓫᐗb[0],b[l]Wbফ9)*ᑴjsValueᦪᩭtuÃ,-9ᨬFGᵨᦪwriteDatIᦪb□Ḅ|Jᑮout.datᦻL)QᦋSTᦪmainWᑏᦪwriteDatḄᑁZ#includeintb[3];jsValue(){inta1=1,a2=1,a12,sn,k=2;sn=al+a2;while(l){al2=al+2*a2;if(sn<100&&sn+a12>=100)b[O]=k;if(sn<1000&&sn+a12>=1000)b[l]=k;if(sn 164M=1000,n=%d 165M=10000,n=%d 166',,b[0],b[l],b[2]);writeDat();writeDat() 167FILE*fp;fp=fopen("out.dat",“w")_printfC9%d 168%d 169%d 170",b[0],b[l],b[2]);fprintf(fp,n%d 171%d 172%d 173°,b[0],b[l],b[2]);fclose(fp);ਭ⚪b36ᦪReadDattu1ᦻLENGINÅÆÇᦻᦻÈ9%ᐭᑮijÉᦪxx_)*ᑴᦪencryptChar(),ᢥÊËḄÌ@ᐵ·¼ᦪxxḄᡠᨵij56Ì@9E%ᐭᦪxxḄ¼½ḄkÍ9ᨬFGᵨᦪWriteDatI'DxxJᑮᦻLpS6.DATÌ@ᐵ·f(p)=p*llmod256(pᦪ¯ÅijḄASCII|9f(p)FÎijḄASCII|)9DFf(p)|4m32ᡈf(p)¼½ḄijᦪiÐ9,ᑣÑijÒ9ᔲᑣÔf(p)ᡠ¼½Ḅij56Ì@ᑖMNO%ᙠᦻLprogl.cᦪVᦻL%Ḅf6ḄÕÖᙳ480ij)QᦋSTᦪmainஹᦪVᦪReadDat()WJᦪVᦪWriteDatḄᑁZ#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻÈḄ×6ᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,j;for(i=0;i 174if(ReadDat()){printf("ᦪVᦻLENGIN-ᡭÙ 175\007");return;)encryptChar();WriteDat();)intReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen("eng.inn,nru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]An*);if(p)*p=O;i++_)maxline=i;fclose(fp);return0;}voidWriteDat(void)(FILE*fp;inti;fp=fopen("ps6.datM,uwM);for(i=0;i 176,',xx[i]);fprintf(fpÚrs 177“,xx[iD_)fclose(fp);⚪b37ᦪReadDattu1ᦻLENGINÅÆÇᦻᦻÈ9%ᐭᑮijÉᦪxx_)*ᑴᦪencryptChar(),ᢥÊËḄÌ@ᐵ·¼ᦪxxḄᡠᨵij56Ì@9E%ᐭᦪxxḄ¼½ḄkÍ9ᨬFGᵨᦪWriteDatI'DxxJᑮᦻLPS7.DAT 178Ì@ᐵ·f(p)=p*llmod256(pᦪ¯ÅijḄASCH|9f(p)FÎijḄASCII|)9DijᜧᑏiÛᡈFf(p)|4m32,ᑣÑijÒ9ᔲᑣÔf(p)ᡠ¼½Ḅij56Ì@ᑖMNO%ᙠᦻLprogl.cᦪVᦻL%Ḅf6ḄÕÖᙳ480ij)QᦋSTᦪmainஹᦪVᦪReadDatWJᦪVᦪWriteDatḄᑁZ#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻÈḄ×6ᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,j;for(i=0;i 179\007");return;)encryptChar();WriteDatO;intReadDat(void)1FILE*fp;inti=0;unsignedchar*p;if((fp=fopen("eng.inH,Mru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){ 180p=strchr(xx[i]An*);if(p)*p=O;i++_)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(Mps7.dat",uw");for(i=0;i 181,',xx[ij);fprintf(fp,n%s 182n,xx[i]);)fclose(fp);⚪b38cdᙠᦻLIN.DAT%ᨵ100>?├!"#9f>?├!"#ᵫ>?@ṹdmhij4kl9>?]^mehij10kl9ᓫdjhl9ᦪsihl9 jehlᑖᡂᐸ =ᓫ*ᦪᦪReadDat 100├!"#$%ᐭ'᪀ᦪsell)*ᑴᦪSortDat9ᐸ,-⌕/ᢥ>?@ṹ14ᑮᜧ56ᑡ9:>?@ṹ;<9ᑣᢥ 14ᑮᜧ56ᑡ9ᨬCᑡ'DE%ᐭ'᪀ᦪsell9ᨬFGᵨᦪWrileDatI'DJᑮᦻLOUT6.DATᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmainஹᦪVᦪReadDatWJᦪVᦪWriteDat ḄᑁZ#include#include#include#include#include#defineMAX100typedefstruct{chardm[5];>?nÜṹ*/char>?]^p 183intdj;/*ᓫ*/intsi;/*ᦪᑓlongje;/* */}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+l;j<100;j++)if(strcmp(sell[i].dm,sell[j].dm)>Ollstrcmp(sell[i].dm,sell[j].dm)==O&&sell[i].je>sen[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}voidmain()(memset(sell,0,sizeof(sell));ReadDat();SortDat();WriteDat();}voidReadDat()(FILE*fp;charstr[8O],ch[l1];inti;fp=fopen(,'IN.DAT","r");for(i=0;i<100;i++){fgets(str,8O,fp);memcpy(sell[i].dm,str,4)_memcpy(sell[i].mc,str+4,10);memcpy(ch,str+14,4)_ch[4]=0;sell[i].dj=atoi(ch);memcpy(ch,str+18,5);ch[5]=0;sell[i].sl=atoi(ch);sell[i].je=(long)sell[i].dj*sell[i].sl;)fclose(fp); 184voidWriteDat(void)FILE*fp;inti;fp=fopen(HOUT6.DAT',_'wn);for(i=0;i<100;i++){printf(H%s%s%4d%5d%5d 185M,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,”rs%s%4d%5d%5d 186",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਭਮ⚪b39uᨵÅ10Þ1006Ḅ⌱ἠᦪVᦻLIN.DAT,ᐸᦪV%Ḅfᩩ"#ḄÖᙳq10k9àÅk⊤âà•ÞḄ⌱äå9àk⊤âàÞḄ⌱äå9ºÃæçᑁZᙳqijW1,1⊤âÃÞ⌱90⊤âÃÞè⌱9ᐰ⌱ᡈ⌱ᙳqᦔḄ⌱ἠÊËᦪReadDatOḄ,-I⌱ἠᦪVᐭᑮijÉᦪxx)*ᑴᦪCountRs()ᩭëfÞḄ⌱ἠᦪ$Iἠᦪº»%ᐭyyìᑮyy[9]I'DyyJᑮᦻLOUT.DATᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmainஹᦪVᦪReadDatWJᦪVᦪwriteDatḄᑁZ#includecharxx[100][ll];intyy[10];intReadDat(void);voidWriteDat(void);voidCountRs(void){inti,j,count;for(i=0;i<100;i++){count=0;for(j=0;j<10;j++)if(xx[i]U]==r)count++;if(count==OIlcount==10)continue;for(j=0;j<10;j++)if(xx[i][j]==,r)yy[j]++_ 187voidmain()inti;for(i=0;i 188\007u);return;)CountRs();WriteDat();intReadDat(void)(FILE*fp;inti;if((fp=fopen("IN.DAT",,,rM))==NULL)return1;for(i=0;i<100;i++){if(fgets(xx[i],11,fp)==NULL)return1;xx[i][10]=V)';)fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(,,OUT.DAT',_,w");for(i=0;i<10;i++){fprintf(fp,n%d 189u,yy[i]);printf("àrdÞḄ⌱ἠᦪ=%d 190”,i+l,yy[i])_)fclose(fp); 191ਮ⚪b40cdᙠᦻLIN.DAT%ᨵ:í(ᦪ<200)îkᦪiḄïᦪ9ᦪReadDat:íïᦪ$%ᐭᦪxx)*ᑴᦪCalValue9ᐸ,-⌕/1ஹ/ᦻLᐳᨵñòïᦪtotNum_2ஹ/¤ᦪḄᔜkᦪiWᏔᦪḄᦪḄᦪtotCnt,}~ª«ÃᩩLḄ¤ᦪḄózᙳ|totPjz,ᨬFGᵨᦪwriteDat()Iᡠ/Ḅ'DJᑮᦻLOUT.DATᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmainஹᦪReadDatWᑏᦪwriteDatḄᑁZ#include#include#defineMAXNUM200intxx[MAXNUM];inttotNum=0;/*ᦻLIN.DATᐳᨵñòïᦪ*/inttotCnô0;/*jᔠᩩLḄïᦪḄᦪ*/doubletotPjz=0.0;/*zᙳ|*/intReadDat(void);voidwriteDat(void);voidCalValue(void){inti,qw,bw,sw,gw;for(i=0;i 192if(ReadDat()){printf("ᦪVᦻLIN.DAT-ᡭ!\007 193")_return;)CalValue();printf("ᦻLIN.DATᐳᨵïᦪ=%d 194”,totNum);printf("jᔠᩩLḄïᦪḄᦪ=%d 195”,totCnt);printf("zᙳ|=%.2f 196”,totPjz);writeDat();intReadDat(void)(FILE*fp;inti=0;if((fp=fopen(,,IN.DAT,'_,r"))==NULL)return1;while(!feof(fp)){fscanf(fp/'%d,",&xxli++J);)fclose(fp);return0;}voidwriteDat(void)(FILE*fp;fp=fopen("OUT.DAT"_'wn);fprintf(fp,n%d 197%d 198%6.2f 199u,totNum,totCnt,totPjz);fclose(fp);)ਮ⚪b41ᑡNOprogl.cḄ,-öᯠᦪSIXWNINE,øùª«ḄᩩLSIX+SIX+SIX=NINE+NINEḄᦪent}~ª«ÃᩩLᡠᨵḄSIXNINEḄWSUM)*ᑏᦪcountValue()tuNOḄ⌕/9ᨬFGᵨᦪwriteDatI'DentWsum,JᑮᦻLOUT15.DATᐸḄS,LX,N,Eᔜ@⊤Åᓝ5ᑴᦪiᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmain()WJᦪVᦪwriteDatḄᑁZ#includeintent,sum;voidcountValue(){ints,i,x,n,e,six,nine; 200for(s=l;s<10;s++)for(i=0;i<10;i++)for(x=0;x<10;x++)for(n=l;n<10;n++)for(e=0;e<10;e++){six=s*100+i*10+x;nine=n*1000+i*100+n*10+e;if(3*six==2*nine){cnt+4-;sum+=six+nine;}))voidmain()(cnt=sum=0;countValue();printf("ª«ᩩLḄᦪ=%d 201”,cnt);printf("ª«ᩩLᡠᨵḄSIXNINEḄW%d 202”,sum);writeDat();)writeDat()(FILE*fp;fp=fopen("OUT15.DAT,',,'wu);fprintf(fp,,,%d 203%d 204",cnt,sum);fclose(fp);)⚪b42cdᙠᦻLIN.DAT%ᨵ100>?├!"#9f>?├!"#ᵫ>?@ṹdm(ij4k)9>?]^me(ij10k)9ᓫdj()9ᦪsi()9 je()ᑖᡂᐸ =ᓫ*ᦪᦪReadDat()100├!"#$%ᐭ'᪀ᦪsell)*ᑴᦪSortDat9ᐸ,-⌕/ᢥ>?]^1ᜧᑮ456ᑡ9:>?]^;m9ᑣᢥ 1ᜧᑮ456ᑡ9ᨬCᑡ'DE%ᐭ'᪀ᦪsell9ᨬFGᵨᦪWriteDat()I'DJᑮᦻLOUT5.DATᑖMNO%ᙠᦻLprogl.c)QᦋSTᦪmainஹᦪVᦪReadDatWJᦪVᦪWriteDatḄᑁZ#include#include#include 205#include#include#defineMAX100typedefstruct{chardm[5];/*>?@ṹ*/char>?]^*/intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/* */}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+1;j<100;j++)if(strcmp(sell[i].mc,sell[j].mc) 206sell[i].dj=atoi(ch);memcpy(ch,str+18,5);ch[5]=0;sell[i].sl=atoi(ch);sell[i].je=(long)sell[i].dj*sell[i].si;)fclose(fp);)voidWriteDat()(FILE*fp;inti;fp=fopen(nOUT5.DATV9wu);for(i=0;i<100;i++){printf(n%s%s%4d%5d%5d 207n,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,H%s%s%4d%5d%5d 208M,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਭ⚪b43id82⚪(úÔ'Dᢥ“1ᜧᑮ4”O)ᦪReadDat()tu1ᦻLin.dat206ᦪV%ᑮijÉᦪxx(f6ijÉÖᙳ480))*ᑴᦪjsSort9ᐸᦪḄ,-}6qᓫk¼ijÉÒḄ᪗qᦪḄijᢥᐸASCII|14ᑮᜧḄýO56O9OFḄ'DEᢥ6þÎ%ᐭijÉᦪxx9ᨬFGᵨᦪWriteDatI'DxxJᑮᦻLout.datÿ01234567abcdefghᑣᜐᳮahcfedgbᑖᙠᦻprogl.cᦋᦪmainஹᦪᦪReadDat!"#ᦪᦪWriteDat()Ḅᑁ&#include#include#includecharxx[20][80];voidjsSort(){inti,j,k,strl;charch;for(i=0;i<20;i++){strl=strlen(xx[i]); 209for(j=l;jfor(k=j+2;kif(xx[i][j]>xx[i][k]){ch=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=ch;}))voidmain()(readDat();jsSort();writeDat();)readDat()(FILE*in;inti=0;char*p;in=fopen(,,in.dat',/'rH);while(i<20&&fgets(xx[i],80,in)!=NULL){p=strchr(xx[i]^n*);if(p)*p=O;i++'}fclose(in);)writeDat()(FILE*out;inti;out=fopen(,,out.dat,,,,'wn);clrscr();for(i=0;i<20;i++){printf(',%s 210,',xx[i]);fprintf(out,n%s 211u,xx[i]);)fclose(out);) 212ਭਮ⚪+44ᦪReadDat,-.ᦻin.dat/200ᦪ1ᑮᦪ3xx(5067ᙳ9:80);ᑴᦪjsSort(),ᐸᦪḄ>?@A0BᓫDᢥFGḄᩩI0KḄLMNᢥ0OPᐭᦪ3xxKᨬSᵨᦪWriteDat()ULMxx"#ᑮᦻout.datᩩ.VWᑖBXKYZᑖᢥḄASCII[\KYZᑖ]^ZᑖI0_ᣚMa67BᦪKᑣᨬVḄcdeᜐᳮKN1ᙠafg012345678abcdhgfe123498765ᑣᜐᳮhgfedcba876594321ᑖᙠᦻprogl.cᦋᦪmain()>ᦪᦪReadDat()!"#ᦪᦪWriteDatḄᑁ&#include#include#includecharxx[20][801;voidjsSort(){inti,j,k,strl,half;chartemp;for(i=0;i<20;i++){strl=strlen(xx[i]);half=strl/2;for(j=0;j 213FILE*in;inti=0;char*p;in=fopen(uin.datu,,Krn);while(i<20&&fgets(xx[i],80,in)!=NULL){p=strchr(xx[i]An');if(p)*p=O;i++')fclose(in);)writeDat(){FILE*out;inti;clrscr();out=fopen("out.dat,',,,w");for(i=0;i<20;i++){printf("%s 214",xx[i]);fprintf(out,"%s 215",xx[i]);)fclose(out);ਭ⚪+45hiᦪᦻIN.DATᨵ200klᦪKmhSᵨᦪreadDatUnoᦪᐭᦪ3aKὃq;ᑴWᦪjsVal(),ᐸ>?@rs.ᦪ3a/#WklᦪKMtlᦪuvᜧ:tlᦪAxḄykᦪztᦪ@Ꮤᦪ(tlᦪAxc|ykᦪKᑣc}~),ᑣ}~#|ᩩḄkᦪentmUnolᦪᢥ.ᜧᑮ9Ḅᐭᦪ3bKᨬSᵨᑏᦪwriteDat()ULMentAᦪ3bᔠᩩḄlᦪ"#ᑮOUT.DATᦻᑖᙠᦻprogl.chGᦪ3a[200],b[200],hGentᦋᦪᦻIN.DATḄᦪஹᦪmainஹᦪreadDat()!ᑏᦪwriteDat()Ḅᑁ&#include#defineMAX200intafMAX],b[MAX],ent=0; 216voidjsVal(){inti,j,flag;for(i=5;i 217”,ent);for(i=0;i 218");writeDat();writeDat()(FILE*fp;inti;fp=fopen("out.dat","w");fprintf(fp,"%d 219",ent);for(i=0;i 220u,b[i]);fclose(fp);) 221ਮ⚪+46hiᦪᦻIN.DATᨵ200klᦪKmhSᵨᦪreadDatUnoᦪᐭᦪ3aKὃq;ᑴWᦪjsVal(),ᐸ>?@rs.ᦪ3a/#WklᦪKMtlᦪuvᜧ:tlᦪAxḄykᦪztᦪ@ᦪKztᦪ?7◀(tlᦪAxc|ykᦪKᑣc}~)Kᑣ}~#|ᩩḄkᦪentmUnolᦪᢥ.ᜧᑮ9Ḅᐭᦪ3bKᨬSᵨᑏᦪwriteDat()ULMentAᦪ3bᔠᩩḄlᦪ"#ᑮOUT.DATᦻᑖᙠᦻprogl.chGᦪ3a[200],b[200],hGentᦋᦪᦻIN.DATḄᦪஹᦪmainஹᦪreadDat!ᑏᦪwriteDat()Ḅᑁ&#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsValO{inti,j,flag;for(i=5;i 222”,ent);for(i=0;i 223n); 224writeDat();writeDat()(FILE*fp;inti;fp=fopen("out.dat",nwu);fprintf(fp,H%d 225",ent);for(i=0;i