南开二级c语言一百题

南开二级c语言一百题

ID:83395805

大小:15.91 MB

页数:156页

时间:2023-07-15

上传者:无敌小子
南开二级c语言一百题_第1页
南开二级c语言一百题_第2页
南开二级c语言一百题_第3页
南开二级c语言一百题_第4页
南开二级c语言一百题_第5页
南开二级c语言一百题_第6页
南开二级c语言一百题_第7页
南开二级c语言一百题_第8页
南开二级c语言一百题_第9页
南开二级c语言一百题_第10页
资源描述:

《南开二级c语言一百题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

ᓭ100⚪ூ᩽┯2.0᱐௃⚪1(id14ஹid27(isP()ᦪᣩᡂid23⚪)ᑏᦪjsValue(intm,intk,intxx)ᦪḄ!"#ᜧ%᦮ᦪm'(☠mḄk*ᦪ+ᐭᦪ-xx./஺ᨬ23ᵨᦪwriteDat஺5610-ᦪ7ᑖ9:;<='><=?;ᑮᦻBout.datC஺DᑖEFG+ᙠᦻBprog1.cC஺I᝞"K?ᐭ175ᑣM?;"19,23,29,31,37஺NᦋPQᦪmain()RᑏᦪwriteDat஺ḄᑁT஺#include#includevoidreadwriteDat();intisP(intm)(inti;for(i=2;i0;m++)if(isP(m)){xx[s++]=m;k—;}}main()(intm,n,xx[1000];clrscr();printf(n

1Pleaseentertwointegers:");scanf(0%d%dM,&m,&n);num(m,n,xx);for(m=0;m

2M);readwriteDat();)voidreadwriteDat()(intm,n,xx[1000],i;FILE*rf,*wf;

3rfVfopen("in.dat",T');wf=fopen("out.dat',,"w,');for(i=0;i<10;i++){fscanf(rf,"%d%dH,&m,&n);num(m,n,xx);for(m=0;m

4n);)fclose(rf)fclose(wf);)id14⚪(isP()ᦪ)#includevoidjsValue(intm,intk,intxx[]){inti,j,s=O;for(i=m+l;k>0;i++){for(j=2;j

5?ᐭW᦮ᦪ:")scanf(n%d%dn,&m,&n);jsValue(m,n,zz);for(m=0;m

6H);writeDat();)writeDat()(intm,n,zzll00],i;FILE*in,*out;in=fopen("in.datn,"rM);out=fopen(',out.dat',,',wH);for(i=0;i<10;i++){fscanf(in,n%d%d",&m,&n);jsValue(m,n,zz);for(m=0;m

7fprintfCout/An");)fclose(in);fclose(out);)Z[\"voidnum(intm,intk,intxx[])(intn=0,data=m+1;while(nefᦪ+ᐭᦪ-aCὃhᑴᦪjsVal(),ᐸ!"᝞=bcᦪᔜclḄᦪmᙳ!஺ᡈ2ᡈ4ᡈ6ᡈ8,ᑣpq;rstᩩBḄᦪent,d>efbcᦪᢥwᜧᑮxḄyG+ᐭᦪ-bC஺ᨬ2main()ᦪ3ᵨᑏᦪwriteDat஺><=entz{ᦪ-bC|ᔠᩩBḄbcᦪ?;ᑮOUT.DATᦻBC஺~"DᑖEFG+ᙠᦻBprogl.cC஺FGC_ᦪ-:a[200],b[200],_"entNᦋPᦪ7ᦻBIN.DATCḄᦪ7ஹQᦪmain஺ஹ5ᦪreadDat஺RᑏᦪwriteDat()ḄᑁT஺#include#defineMAX200intalMAXJ,b[MAXJ,ent=0;voidjsVal(){inti,j,qw,bw,sw,gw;for(i=0;i

8voidmain()inti;readDat();jsVal();printf("rsᩩBḄᦪ=%d

9”,ent);for(i=0;i

10M);writeDat();)writeDat()(FILE*fp;inti;fp=fopen(nout.dat","wu);fprintf(fp,H%d

11",ent);for(i=0;i

12",b[i]);fclose(fp);)ਭਮ⚪3(id133⚪ᣩᡂid59ஹ99m|c᎔⚪)ᦪReadDat()wᦻBIN.DATC56•ᦻᦻ+ᐭᑮm|ᦪ-xxCᑴᦪStrOR(),ᐸᦪḄ!"zᓫc>m|Cᡠᨵxᑏm஺Ḅm|ᑁTᑮḄ+ᯠ2>xᑏm஺ᑤ◀Ḅm|ᑁTᑮ_ᜐᳮm|Ḅ+£2>_ᜐᳮḄm|¤ᢥ¥¦+ᐭm|ᦪ-xxC஺ᨬ2main஺ᦪ3ᵨᦪWriteDat஺><=xx?;ᑮᦻBOUT5.DATC஺I᝞"§ᦻ"nanyfield.Yucancreateanindexyouhavethecorrectrecord.<="nanyfield.Yucancreateanindexrd.yuhavethecrrectrec§¨ᦪ7ᦻB+Ḅ©ª!"«Ḅ¬ᙳx%80m|®᪗°|±R²©஺~"DᑖEFG+ᙠᦻBprogl.cC஺NᦋPQᦪmain஺ஹ5ᦪ7ᦪReadDat஺R?;ᦪ7ᦪWriteDat஺ḄᑁT஺#include#include#includecharxx[50][801;intmaxline=0;/*ᦻḄµᦪ*/intReadDat(void);voidWriteDat(void);voidStrOR(void){inti,righto,j,s,k;chartem[80];for(i=0;ivmaxline;i++)/*᎔G¶·*/

13for(j=strlen(xx[i])-1;j>=O;j—){k=0;memset(tem,0,80);/*¸¨ᓄm|ᦪ-tem*/if(xx[i][j]==,o,)/*᝞=º»m|'o',¼ᐭz½¾*/{righto=j;/*ᑣ#tm|CcjḄ¿ÀÁrighto*/for(s=righto+1;s

14\007");retum;)StrOR();WriteDat();)intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen(nIN.DATn,V))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xxli],'

15');if(p)*p=0;i++)maxline=i;fclose(fp);return0;voidWriteDat(void)

16FILE*fp;inti;clrscr();fp=fopen(nOUT5.DAT",nwu);for(i=0;i

17",xx[i]);fprintf(fp,n%s

18H,xx[i]);)fclose(fp);)[\V"voidStrOR(void){inti;chara[80],*p;for(i=0;i

19"#m|srcC»maxlenm|ÑÒᑮdestCÕᐵᜮᦻB"string.hchar*strcpy(char*dest,constchar*src)"#m|srcÎÏᑮm|destCÐÕᐵᜮᦻB"string.hਭਮ⚪4(id24⚪ᣩᡂid9m|ᓫÚ᎔⚪)ᦪReadDat஺wᦻBIN.DATC56ᦻᦻ+ᐭᑮm|ᦪ-xxCᑴᦪStrOL(),ᐸᦪḄ!"zᓫcÛCz²©ᡈ᪗°|±ᑖ◞ḄᡠᨵᓫÚ¼᎔᣸஺ᨬ2>_ᜐᳮḄm|(MÅ®᪗°|±)¤ᢥ¥¦+ᐭm|ᦪ-xxCᨬ23ᵨᦪwriteDat஺><=xx?;ᑮᦻBOUT6.DATC஺I᝞"§ᦻ"YouHeMeIamastudent.<="MeHeYoustudentaamI§¨ᦪ7ᦻB+Ḅ©ª!"«Ḅ¬ᙳx%80m|®᪗°|±R²©஺DᑖEFG+ᙠᦻBprogl.cC஺NᦋPQᦪmain()>5ᦪ7ᦪReadDat()R?;ᦪ7ᦪwriteDat஺ḄᑁT஺#include#include#include#includecharxx[50][801;intmaxline=0;/*ᦻḄµᦪ*/intReadDat(void);voidWriteDat(void);/*ᙠ{ᣩᡂ᱐ÝÞßpCÃàáâã(?ᐭᦻB¾äᨵ᪗°Ḅᙠ?;ᦻBC¾»ᨵ²©*/voidStrOL(void){inti,j,k,s,m,strl;charstr[80J;for(i=0;i=0é)/*wº»m|êD¨ᔣ»᎔G¶·,⚪⌕íḄ᎔᣸*/{if(isalpha(xx[i][j]))k++;/*᝞=º»m|!ma~zᡈA~Z,ᑣkî*/else{for(m=1;m<=k;m++)/*ᔲᑣ#ðkḄᓫÚyG+ᐭᑮm|ᦪ-strC,s¿î1*/str[s++]=xx[i][j+m];k=0;/*#k¿ñ0,zòóᓫÚḄðqᦪ*/)if(!isalpha(xx[iç))str[s++]="/*᝞=º»m|Å!maôzᡈA~Z,ᑣz²©õ£+

20ᐭᑮm|ᦪ-strC,s¿î*/)for(m=l;mv=k;m++)/*töḄk¿º»m|C÷ᓫÚḄðøᙠlfor¶·Cù+ᐭᑮm|ᦪ-strCᡠzᙠeú#ᐸ+ᐭᑮstrC*/str[s++]=xx[i][j+m];strlsk'O';/*ᙠº»êî0z᪗ûtḄ<ü*/strcpy(xx[i],str);/*#᎔᣸ýḄº»m|¥¦+/ᑮº»xxC*/))voidmain(){clrscr();if(ReadDat()){primf("ᦪ7ᦻBIN.DATÅᡭþ

21\007-1);return;)StrOL();WriteDat();)intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen(nIN.DAT","rn))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],'

22');if(p)*p=O;i++;)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen("OUT6.DATV'wH);

23for(i=0;i

24",xx[i]);fprintf(fp,H%s

25",xx[i]);)fclose(fp);)ᣩᡂ᱐ÝÞßpCḄ[\/*ᙠÝÞßpCùàáâã(?ᐭᦻB¾äᨵ᪗°Ḅᙠ?;ᦻBC¾»²©*/voidStrOL(void)(inti,j;charword[21],yy[80],zz[80],*p;for(i=0;i=O;j—)if(!isalpha(xx[ij|j]))

26{strcat(str,xx[i]+j+1);strcat(str,nM);xx[i][j]=W;)strcat(str,xx[i]);strcpy(xx[i],str);))▭ὃ☢ᵨ஺ਭਮ⚪5(id8᦮ᦪ᣸⚪)ᙠᦻin.datᨵ200!"᦮ᦪ#$%!ᦪᙳᙠ1000'9999()஺*ᦪReadDat஺+,-200!ᦪ./ᑮᦪ1aa஺23ᑴ*ᦪjsSort(),ᐸ*ᦪḄ789:⌕<ᢥ%!ᦪḄ>?@ḄᜧBCDᓣ᣸ᑡ#ᯠ>,HIJKᩩḄM10!ᦪNO.ᐭᦪ1bb#᝞R>?@ḄᦪSTU#ᑣᢥWᐜḄᦪSCDY᣸ᑡ஺ᨬ>[ᵨ*ᦪWriteDat()\]Rbb^Hᑮᦻout.dato`:ᜐᳮM60125099901270258088ᜐᳮ>90126012702580885099cᑖef.ᙠᦻprogl.c஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat஺m^Hᦪl*ᦪWriteDat஺Ḅᑁo஺#include#include#includeintaa[200],bb[10];voidjsSort()(inti,j,data;for(i=0;i<199;i++)for(j=i+1;j<200;j++)if(aa[i]%1000>aa[jJ%1000llaa[i]%1OOO==aa|jJ%1000&&aa[i]

27FILE*in;inti;in=fopen("in.dat,',,,rn);for(i=0;i<200;i++)fscanf(in,u%d,",&aa[i]);fclose(in);)writeDat()(FILE*out;inti;clrscr();out=fopen(,'out.dat","w'');for(i=0;i<10;i++){printf(n%dn,bb[i]);fprintf(out,H%d

28';bb[i]);)fclose(out);)⚪6"᦮ᦪ᣸ᙠᦻin.datᨵ200!"᦮ᦪ#$%!ᦪᙳᙠ1000'9999()஺*ᦪReadDat஺+,-200!ᦪ./ᑮᦪ1aa஺23ᑴ*ᦪjsSort(),ᐸ*ᦪḄ789:⌕<ᢥ%!ᦪḄ>?@ḄᜧBCDY᣸ᑡ#ᯠ>,HIJKᩩḄM10!ᦪNO.ᐭᦪ1b#᝞R>?@ḄᦪSTU#ᑣᢥWᐜḄᦪSCDᓣ᣸ᑡ஺ᨬ>[ᵨ*ᦪWriteDat஺\]Rbb^Hᑮᦻout.dat஺`:ᜐᳮM90125099601270258088ᜐᳮ>50998088702560129012pq:cᑖefrsH஺2gᦋij*ᦪmain()^+ᦪl*ᦪReadDat஺m^Hᦪl*ᦪWriteDat஺Ḅᑁo஺#include#include#includeintaal200J,bbl10J;voidjsSort()(inti,j,data;for(i=0;i<199;i++)for(j=i+1;j<200;j++)

29if(aa[i]%1000aafj]){data=aa[i];aa[i]=aa[j];aa[j]=data;}for(i=0;i<10;i++)bb[i]=aa[i];)voidmain()(readDat();jsSort();writeDat();system(npausen);)readDat()(FILE*in;inti;in=fopen(nin.dat",nru);for(i=0;i<200;i++)fscanf(in,"%dt',&aa[i]);fclose(in);)writeDat()(FILE*out;inti;clrscr();outufopen("out.dat"Jw")tfor(i=0;i<10;i++){printf(Mi=%d,%d

30",i+l,bb[i]);fprintf(out,"vd

31”,bb[i]);)fclose(out);ਭ⚪7wid15]᪀yz{⚪||}~ᙠᦻIN.DAT.ᨵ100!├#%!├ᵫṹdmw4@|#mew10@|#ᓫdjw᦮|#ᦪsiw᦮|#jew᦮|cᑖ1ᡂ஺ᐸ:=ᓫ*ᦪH஺*ᦪReadDat9+,-100!├.ᐭ]᪀ᦪ1sell஺23ᑴ*ᦪSorlDat஺#ᐸ78⌕<:ᢥṹᜧᑮBCD᣸ᑡ#

32ṹT#ᑣᢥᜧᑮBCD᣸ᑡ#ᨬ᣸ᑡ]R.ᐭ]᪀ᦪ1sell#ᨬ>[ᵨ*ᦪWriteDat஺\]R^HᑮᦻOUT6.DAT஺cᑖef.ᙠᦻprog1.c஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat஺m^Hᦪl*ᦪWriteDat஺Ḅᑁo஺#include#include#include#include#include#defineMAX100typedefstruct)chardm[5];/*ṹ*/charmc[ll];/**/intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/**/}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){intij;PROxy;for(i=0;i<99;i++)for(j=i+l;j<100;j++)if(strcmp(sell[i].dm,sell|j].(im)

33fp=fopen("IN.DAT',,',rn);for(i=0;i<100;i++){fgets(str,80Jp);memcpy(sell[i].dm,str,4);memcpy(sell[i].mc,str4-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);voidWriteDat(void)(FILE*fp;inti;fp=fopen("OUT6.DAT”,W);for(i=0;i<100;i++){printf("%s%s%4d%5d%5d

34n,sell[i].dm,sen[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,,,%s%s%4d%5d%5d

35'\sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);ਭਮ⚪8(id83¡ᣚ⚪)*ᦪReadDat஺£¤ᦻENGIN+,}¥¦ᦻᦻ§#.ᐭᑮ¨ᦪ1xxt23ᑴ*ᦪencryptChar(),ᢥs©Ḅ¡ᐵ«¬ᦪ1xxḄᡠᨵCD¡#.ᐭᦪ1xxḄ¬®Ḅ@¯#ᨬ>[ᵨ*ᦪWriteDat()\]Rxx^HᑮᦻPS1.DAT஺¡ᐵ«:f(p)=p*llmod256(p9ᦪ1°}!ḄASCHS#f(p)9>±ḄASCHS)#᝞R>f(p)SB²U²32ᡈᜧ²130,ᑣ´µ¶#ᔲᑣ¸f(p)ᡠ¬®ḄCD¡஺cᑖef.ᙠᦻprogl.c஺W¹ᦪlᦻ./Ḅº»9:%DḄ¼½ᙳB²80!஺2gᦋij:*ᦪmain஺ஹ+ᦪl*ᦪReadDat()m^Hᦪl*ᦪWriteDat஺Ḅᑁo஺#include#include#include#includeunsignedcharxxl50J[80J;

36intmaxline=O;/*ᦻ§Ḅ¿Dᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,j;for(i=0;i130)continue;elsexx[i][j]=xx[i][j]*l1%256;)voidmain()(clrscr();if(ReadDat()){printf("ᦪlᦻENGINµ8ᡭÃÄ

37\007");return;)encryptChar();WriteDat();)intReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(neng.inM,uru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],

38,)tif(p)*p=O;i++t)maxline=i;fclose(fp);return0;)voidWriteDat(void)FILE*fp;

39inti;fp=fopen("psl.dat'V'w");for(i=0;i

40”,xx[i]);fprintf(fp,"%s

41",xx[i]);)fclose(fp);)u:voidencryptChar(){inti,j,k;for(i=0;i130)continue;elsexx[i][j]=k;)}?:voidencryptChar(){inti,jtunsignedcharch;for(i=0;i130)continue;elsexx[ij|jj=ch;)}Å:voidencryptChar(){inti,j;char*p;for(i=0;i130)continue;elsexx[i][jl=p;):voidencryptChar(){inti;

42char*pf;for(i=0;i130)pf++;else*pf++=*pf*11%256;})ਭਮ⚪9(id28tid124tᣩᡂid16¨᣸⚪)*ᦪReadDat()£¤ᦻIN.DAT+,}¥¦ᦻᦻ§.ᐭᑮ¨ᦪ1xx#23ᑴ*ᦪSortCharDO,ᐸ*ᦪḄ789:DÇᓫ@¬ᢥᜧᑮBḄÈCD᣸#᣸>Ḅ]RᢥDɱ.ᐭ¨ᦪ1xx#ᨬ>[ᵨ*ᦪwriteDat()\]Rxx^HᑮᦻOUT2.DAT஺`:Wᦻ:dAe,BfC.CCbbAA]R:fedCBA.bbCCAAW¹ᦪlᦻ./Ḅº»9:%DḄ¼½ᙳB²80!#Ê᪗ÌÍmκ஺cᑖef.ᙠᦻprogl.c஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat()m^Hᦪl*ᦪwriteDat஺Ḅᑁo஺#include#include#includecharxx[50Jl80J;intmaxline=0;/*ᦻ§Ḅ¿Dᦪ*/intReadDat(void);voidWriteDat(void);voidSortCharD(void){inti,j,k,strl;charch;for(i=0;i

43voidmain()(clrscr();if(ReadDat()){printfCᦪlᦻIN.DATµ8ᡭÃÄ

44\007n);return;)SortCharD();WriteDat();)intReadDat(void)(HLE*fp;inti=0;char*p;if((fp=fopen(',IN.DAT"t,r,,))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]/

45*);if(p)*p=O;i++t)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(',OUT2.DAT,',uw,');for(i=0;i

46n,xx[iJ);fprintf(fp,n%s

47M,xx[i]);)fclose(fp);)⚪10(id68¡ᣚ⚪)*ᦪReadDat()£¤ᦻIN.DAT+,}¥¦ᦻᦻ§.ᐭᑮ¨ᦪ1xx#23ᑴ*ᦪConvertCharA(),ᐸ*ᦪḄ789:DÇᓫ@\¨ḄᡠᨵBᑏÐᦋᑏᡂ´Ð

48ḄÑ}!Ð#᝞R9ÐZ,ᑣᦋᑏᡂÐa஺ᜧᑏÐÇᜧᑏÐ#BᑏÐÇBᑏÐ#ᐸÒµ¶஺\rᜐᳮḄ¨ᢥDɱ.ᐭ¨ᦪ1xx#ᨬ>[ᵨ*ᦪwriteDat஺\]Rxx^HᑮᦻOUT1.DAT஺`:Wᦻ:Adb.Bcdzaabck.LLhj]R:Aec.Bdeabbcdl.LLikW¹ᦪlᦻ./Ḅº»9:%DḄ¼½ᙳB²80!#Ê᪗ÌÍmκ஺cᑖef.ᙠᦻprogl.c஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat஺m^Hᦪl*ᦪwriteDat஺Ḅᑁo஺#include#include#includecharxx[50][801;intmaxline=0;/*ᦻ§Ḅ¿Dᦪ*/iniReadDat(void);voidWriteDat(void);voidConvertCharA(void){inti,j;for(i=0;i=,a'&&xx[ij|jj<=,y,)xxli]|jj+=l;))voidmain()(clrscr();if(ReadDat()){printf("ᦪlᦻIN.DATµ8ᡭÃ!

49\007H);return;)ConvertCharA();WriteDat();)intReadDat(void)(FILE*fp;inti=0;

50char*p;if((fp=fopen(,'IN.DAT",,,ru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],

51*)tif(p)*p=O;i++t)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen(',OUTl.DATnt,wn);for(i=0;i

52”,xx[i]);fprintf(fp,"%s

53n,xxfi]);)fclose(fp);)ਮ⚪11(id93¨ÐÔ@⚪)fprogl.cḄ789:\s¨ḄᡠᨵÐᦋᑏᡂ´ÐḄÑ}!Ð#ÐzᦋᑏᡂÐa஺⌕<ᜧᑏÐÇᜧᑏÐ#BᑏÐÇBᑏÐ#ᐸÕµÖᦋ¶஺2ὃ×3ᑏ*ᦪchg(char*s)£¤f⌕<#ᨬ>[ᵨ*ᦪreadwriteDAT()\]R^Hᑮᦻbe1.out஺`᝞:s¨WᨵḄᑁoÇ:Mn.l23Zxy,ᑣ[ᵨ´*ᦪ>#]RÇ:No.l23Ayzopq:cᑖef.ᙠᦻprogl.cᦻ஺2gᦋij*ᦪmain()m^Hᦪl*ᦪreadwriteDAT஺Ḅᑁo஺#include#include#include#include#defineN81voidreadwriteDATQ;voidchg(char*s){while(*s)

54if(*s==,z,IH:s=="Z,){*s-=25;s++;}elseif(*s>=*a,&&*s<=,y'){*s+=1;s++;}elseif(*s>=*A,&&*s<=,Y,){*s+=1;s++;}elses++;)main()(chara[N];clrscr();printf(''Enterastring:");gets(a);printf(nTheoriginalstringis:")tputs(a);chg(a);printf(nThestringaftermodified:");puts(a);readwriteDAT();)voidreadwriteDAT()(inti;chara[N];FILE*rf,*wf;rf=fopen("bcl.in","rH);wf=fopenCbcLout'1,Hwn);for(i=0;i<50;i++){fscanf(rf,"vs”,a);chgবtfprintf(wf,u%s

55",a);)fclose(rf);fclose(wf);)ਭ⚪12(id78]᪀yÙ⚪⚪)r~ᙠᦻIN.DAT.ᨵ100!├#%!├Úṹdm(4@)#me(10@)#ᓫdj(᦮)#ᦪsi(᦮)#je(᦮)cᑖ1ᡂ஺ᐸ:=ᓫ*ᦪH஺*ᦪReadDat஺9+,-100!├.ᐭ]᪀ᦪ1sell஺23ᑴ*ᦪSorlDat(),ᐸ78⌕<:ᢥBᑮᜧCD᣸ᑡ#TU#ᑣᢥBᑮᜧCD᣸ᑡ#ᨬ᣸ᑡ]R.ᐭ]᪀ᦪ1sell#ᨬ>[ᵨ*ᦪWriteDat஺\]R^HᑮᦻOUT5.DAT஺cᑖef.ᙠᦻprogl.c஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat()m^Hᦪl*ᦪWriteDat஺Ḅᑁo஺

56#include#include#include#include#include#defineMAX100typedefstruct)chardm[5];/*ṹ*/char*/intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/**/}PRO;PROsellfMAX];voidReadDat();voidWriteDat();voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+l;jOllstrcmp(sell[ij.mc,sell|jJ.mc)==O&&sell[i].je>sell[j].je){xy=sell[i];sell[i]=sellfj];sell[j]=xy;})voidmain(){memset(sell,0,sizeof(sell));ReadDat();SoilDat();WriteDat();)voidReadDat()(FILE*fp;charstr[80],ch[ll];inti;fp=fopen("IN.DAT",T);for(i=0;i<100;i++){fgets(str,80,fp);

57memcpy(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);)voidWriteDat()(HLE*fp;inti;fp=fopen(',OUT5.DAT',t,w");for(i=0;i<100;i++){printf(n%s%s%4d%5d%5d

58,',sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fpj%s%s%4d%5d%5d

59';sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)⚪13(id81]᪀yÙ⚪)id81⚪ᢥBᑮᜧCD᣸ᑡr~ᙠᦻIN.DAT.ᨵ100!├#%!├Úṹdm(4@)#me(10@)#ᓫdj(᦮)#ᦪsi(᦮)#je(᦮)cᑖ1ᡂ஺ᐸ:=ᓫ*ᦪH஺*ᦪReadDat஺9+,-100!├.ᐭ]᪀ᦪ1sell஺23ᑴ*ᦪSortDat஺,ᐸ78⌕<:ᢥṹBᑮᜧCD᣸ᑡ#ṹTU#ᑣᢥᜧᑮBCD᣸ᑡ#ᨬ᣸ᑡ]R.ᐭ]᪀ᦪ1sell#ᨬ>[ᵨ*ᦪWriteDat஺\]R^HᑮᦻOUT9.DAT஺cᑖef.ᙠᦻprogl.c஺2gᦋij*ᦪmain()^+ᦪl*ᦪReadDat()m^Hᦪl*ᦪWriteDal஺Ḅᑁo஺#include#include#include#include#include#defineMAX100typedefstruct{chardm[5];/*ṹ*/char*/

60intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/**/}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){intij;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

61voidWriteDat()(FILE*fp;inti;fp=fopen(',OUT9.DAT',,1(w");fdr(i=0;i<100;i++){printf(H%s%s%4d%5d%5d

62",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,H%s%s%4d%5d%5d

63"#sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);}ਮ⚪14(id151᦮ᦪÜ᣸⚪)r~ᦪlᦻIN.DAT.ᨵ200!Å@ᦪ#r[ᵨ+*ᦪreadDat஺\-Ýᦪ.ᐭᦪ1a#2ὃ×3ᑴ}*ᦪjsVal(),ᐸ789:NOᦪ1a,H}!Å@ᦪ#᝞R´Å@ᦪÞßᜧ²´Å@ᦪ>Ḅ!ᦪ$´ᦪ9᜻ᦪ(´Å@ᦪ>µI!ᦪ#ᑣµÜ)#ᑣÜHIJKᩩḄ!ᦪent\-ÝÅ@ᦪᢥBᑮᜧḄÈ.ᐭᦪ1b#ᨬ>[ᵨᑏ*ᦪwriteDat()\]Rentáᦪ1bᔠᩩḄÅ@ᦪ^HᑮOUT.DATᦻ஺pq:cᑖef.ᙠᦻprogLc஺fr©ãᦪ1:a[200],b[200],r©ã¶:ent2gᦋiᦪlᦻIN.DATḄäåᦪlஹj*ᦪmain஺ஹ+*ᦪreadDat஺mᑏ*ᦪwriteDat஺Ḅᑁo஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsVal(){inti,j,flag;for(i=0;ia[j]&&a[i]%2)flag=l;else{flag=O;break;}if(flag==l)b[cnt++]=a[i];)for(i=0;ib[j]){flag=b[i];b[i]=bU]tb[j]=flag;}voidreadDat()inti;

64FILE*fp;fp=fopen(',in.datM,nrn);for(i=0;i

65”,ent);for(i=0;i

66");writeDat();writeDatO(FILE*fp;inti;fp=fopenC'out.dat",nwu);fprintf(fp,"%d

67",ent);for(i=0;i

68n,b[ij);fclose(fp);)⚪15(id150᦮ᦪᔜ@ᦪÙ᣸⚪)r~ᦪlᦻIN.DAT.ᨵ200!Å@ᦪ#r[ᵨ+*ᦪreadDat஺\-Ýᦪ.ᐭᦪ1a#2ὃ×3ᑴ}*ᦪjsVal(),ᐸ789:•!Å@ᦪḄᓟ@ᦪḄSB²U²é@ᦪḄS#é@ᦪḄSB²U²ᓝ@ᦪḄS#áᓝ@ᦪḄSB²U²!@ᦪḄS#$WÅ@ᦪ9Ꮤᦪ#ᑣÜHIJKᩩḄ!ᦪcm\-ÝÅ@ᦪᢥBᑮᜧḄÈ.ᐭᦪ1b#ᨬ>[ᵨᑏ*ᦪwriteDatO\]Rentáᦪ1bᔠᩩḄÅ@ᦪ^HᑮOUT.DATᦻ஺pq:cᑖef.ᙠᦻprogl.c஺fr©ãᦪ1:a[200],b[200],r©ã¶:ent2gᦋiᦪlᦻIN.DATḄäåᦪlஹj*ᦪmain஺ஹ+*ᦪreadDat஺mᑏ*ᦪwriteDat()Ḅᑁo஺#include#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j;

69intqw,bw,sw,gw;for(i=0;ib[j]){qw=b[i];b[i]=b|j];b[j]=qw;}voidreadDat()(inti;FILE*fp;fp=fopen(nin.datM,nr");for(i=0;i

70”,ent);for(i=0;i

71M);writeDat();}writeDat()(FILE*fp;inti;fp=fopen(nout.dat'r,nwu);fprintf(fp,n%d

72",ent);for(i=0;i

73n,b[ij);fclose(fp);)ਭ⚪16(id23¡ᣚ⚪)*ᦪReadDat()£¤ᦻIN.DAT+,}¥¦ᦻᦻ§.ᐭᑮ¨ᦪ1xx#23ᑴ*ᦪSlrCharJRO#ᐸ*ᦪḄ789:DÇᓫ@\¨ᡠᨵḄASCIISìÔ4@#

74ᯠ>\ìÔ>ḄASCIISíîWḄASCIIS#ᑮ±Ḅ.ᐭW¨¬®Ḅ@¯஺ᨬ>\rᜐᳮḄ¨ᢥDɱ.ᐭ¨ᦪ1xx#ᨬ>[ᵨ*ᦪwriteDat஺\]Rxx^HᑮᦻOUT8.DAT஺W¹ᦪlᦻ./Ḅº»9:%DḄ¼½ᙳB²80!#Ê᪗ÌÍmκ஺cᑖef.ᙠᦻprog1.c஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat()m^Hᦪl*ᦪwriteDat()Ḅᑁo஺#include#include#includecharxx[50][80];intmaxline=0;/*ᦻ§Ḅ¿Dᦪ*/intReadDat(void);voidWriteDat(void);voidStrCharJR(){intij;for(i=0;i

75\007n);return;)StrCharJR();WriteDatO;intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen(nIN.DAT","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],,

76');if(p)*p=O;

77i++tmaxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen("OUT8.DAT"/w");for(i=0;i

78",xx[i]);fprintf(fp,"vs

79",xx[i]);)fclose(fp);)ਮ⚪17(ïð¡ᣚ⚪)*ᦪREADDAT()£¤ᦻIN.DAT+,•¥¦ᦻᦻ§.ᐭᑮ¨ᦪ1XX;23ᑴ*ᦪCHA(),ᐸ*ᦪ789:DÇᓫ@\¨Ḅò}!ḄASCHSîòu!ḄASCHS#ᑮò}!ïð#òu!ḄASCIISîò?!ḄASCIIS#ᑮòu!±#NKóô}õᜐᳮᑮᨬ>òu!#ᨬ>}!ḄASCIISîWò}!ḄASCIIS#ᑮᨬ>}!±Ḅ#ᑮḄ±ᑖö./ᙠW¨¬®Ḅ@¯஺ᨬ>\rᜐᳮḄ¨⌮ø>ᢥDɱ.ᐭ¨ᦪ1XX,ᨬ>[ᵨ*ᦪWRITEDAT0\]RXX^HᑮᦻOUT9.DAT.W¹ᦪlᦻ./Ḅº»9:%DḄ¼½ᙳB²80!#Ê᪗ÌÍmκ.pq:cᑖefrsH஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat()m^Hᦪl*ᦪwriteDat()Ḅᑁo஺#include#include#includecharxx[50][80];intmaxline=0;/*ᦻ§Ḅ¿Dᦪ*/intReadDat(void);voidWriteDat(void);voidChA(void){inti,j;

80charch;for(i=0;i

81\007");return;}ChA();WriteDat();)intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen(nIN.DAT",urn))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],'

82');if(p)*P=0;i++t)maxline=i;fclose(fp);return0;}voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen(MOUT9.DATn,nw");

83for(i=0;i

84u,xx[i]);fprintf(fp,n%s

85M,xx[i]);)fclose(fp);)ਮ⚪18(idl⚪)*ᦪReadDat஺£¤ᦻENGIN+,}¥¦ᦻᦻ§#.ᐭᑮ¨ᦪ1xxt23ᑴ*ᦪencryptChar(),ᢥs©Ḅ¡ᐵ«¬ᦪ1xxḄᡠᨵCD¡#.ᐭᦪ1xxḄ¬®Ḅ@¯#ᨬ>[ᵨ*ᦪWriteDat()\]Rxx^HᑮᦻPSI0.DAT஺¡ᐵ«:f(p)=p*llmod256(p9ᦪ1°}!ḄASCIIS#f(p)9>±ḄASCIIS)#᝞RWḄASCIIS9Ꮤᦪᡈ>f(p)SB²U²32,ᑣ´µ¶#ᔲᑣ¸f(p)ᡠ¬®ḄCD¡஺cᑖef.ᙠᦻprogl.c஺W¹ᦪlᦻ./Ḅº»9:%DḄ¼½ᙳB²80!஺2gᦋij*ᦪmain஺ஹ+ᦪl*ᦪReadDat()m^Hᦪl*ᦪWriteDat()Ḅᑁo஺#include#include#include#includeunsignedcharxx[50][801;intmaxline=0;/*ᦻ§Ḅ¿Dᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,jtfor(i=0;i

86\007n);return;encryptChar();

87WriteDat();iniReadDat(void)(HLE*fp;inti=0;unsignedchar*p;if((fp=fopen(neng.inn,uru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]/

88,);if(p)*p=O;i++t)maxline=i;fclose(fp);return0;}voidWriteDat(void)(FILE*fp;inti;fp=fopen("psl0.dat","wH);for(i=0;i

89",xx[i]);fprintf(fp,M%s

90n,xx[iJ);)fclose(fp);}K⚪ûᨵüý#þÿ⚪8⚪19(id144ᓫᦪ⚪)ᑏᦪfindStr(char*str,char*substr),ᦪ2ḄᙠḄᦪ஺᝞!Ꮇ#$ᐭḄ"asdasasdfgasdaszx67asdmklo",“as",ᦪ'()*6஺ᦪReadWrite஺+,ᦻ.in.dat/01!23ᵨᦪfindStr஺!ᨬ6789$ᑮᦻ.oul.dat஺;<=>ᑖ@ABCᙠᦻ.progLc஺DEᦋGHᦪmain()IᐸKᦪḄLMᑁO!PᙠᦪfindStr஺ḄQRSTᐭUᑏḄVWXY஺#include#include#include

91intfindStr(char*str,char*substr){intn=0;char*p,*r;while(*str){p=str;r=substr;while(*r)if(*r==*p){r++;p++;elsebreak;if(*r#(y)n++;str++;)returnn;main()(charstr[81],substr[3];intn;clrscr();printf("$ᐭ]^;gets(str);printf("$ᐭ:“)agets(substr);puts(str);puts(substr);n=findStr(str,substr);printf(nn=%d

92",n);ReadWrite();)ReadWrite()(charstrl81],substr[3J,ch;intn,len,i=0;FILE*rf,*wf;rf=fopen(uin.dat';T1);wf=fopen("out.dat","wu);while(i<25){

93fgets(str,80,rf);fgets(substr,10,rf)alen=strlen(substr)-1;ch=substr[len];if(ch==

94'IIch==Oxla)substr[len]=0;n=findStr(str,substr);fprintf(wf,u%d

95",n);i++a)fclose(rf);fclose(wf);)bcd=intfindStr(char*str,char*substr){intij,lenl,len2,cnt=0,flag;lenl=strlen(str);len2=strlen(substr);for(i=0;i

96(஺ᐸFibonacciᦪᑡF(n)Ḅ#o=F(0)=0,F(l)=lF(n)=F(n-1)+F(n-2)ᨬ63ᵨᦪwriteDat஺/050ᦪpt,ᑖqr89s789$ᑮᦻ.out.dat஺᝞=tt=1000u!ᦪ)=1597஺>ᑖ@ABCᙠᦻ.progl.c஺DEᦋGHᦪmain()IᑏᦪwriteDat஺ḄᑁO஺#includeinijsValue(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

97",n,jsValue(n));writeDat();)writeDat()(FILE*in,*out;inti,n,s;in=fopen(nin.dat,,,,,rM);out=fopen(,'out.dat',,"w,');for(i=0;i<50;i++){fscanf(in,H%d",&n);s=jsValue(n);printf("%d

98",s);fprintf(out,n%d

99n,s);fclose(in);fclose(out);

100⚪21(id53vwxcjxA⚪)yᑡABprogl.cḄhi*=ᑭᵨ{yᡠ}Ḅ~ᓫvwxcjxA=cos(x)-x=0Ḅ+᪷஺Xn+l=cos(Xn)vw᝞y=প0XI)0.0a(2)X0=X1,7X1Ḅ)X0a(3)Xl=cos(X0),jḄXIa(4)VX0-X1Ḅ)ml0.000001,᡻(5),ᔲᑣ᡻(2)a(5)ᡠjXI*xAcos(X)-X=0Ḅ+᪷!ᦪ)'(஺DᑏᦪcountValue()+ABḄ⌕j!ᨬ63ᵨᦪwriteDat()789$ᑮᦻ.OUT17.DAT஺>ᑖ@AB஺DEᦋGHᦪmain஺I$ᦪpᦪwriteDat஺ḄᑁO஺#include#include#includefloatcountValue(){doublex0,x1;x1=0.0;do{x0=x1;xl=cos(x0);}while(fabs(x0-x1)>=0.000001);returnxl;)main()(clrscr();printf("+᪷d%n11",countValue஺)aprintf(,,%f

101H,cos(countValue())-countValue());writeDat();)writeDat()(FILE*wf;wf=fopen(nOUT17.DAT',"wu);fprintf(wf,"%f

102",countValue());fclose(wf)a

103ਭ⚪22(id39x᪷⚪)DᑏᦪcountValue(),KḄhi*=jn{ᑁ(ᒹRn)ui37᦮◀ḄᡠᨵᯠᦪIḄx᪷s,2ᦪ)'(!ᨬ689s$ᑮᦻ.out.dat஺᝞Vn1000u,ᦪ)¡=s=l53.909064»>ᑖ@ABCᙠᦻ.prog1.c஺DEᦋGHᦪmain஺I$ᐭ$ᦪpᦪprogReadWrite஺ḄᑁO஺#include#include#includedoublecountValue(intn){inti;doubles=0.0;for(i=l;i

104”,countValue(1000));progReadWrite();)progReadWrite()(FILE*fp,*wf;inti,n;floats;fp=fopen(Min.datn,"rH);if(fp==NULL){printf("ᦪpᦻ.in.datCᙠ!”)areturn;)wf=fopen(',out.dat",,'w");for(i=0;i<10;i++){fscanf(fp,n%d

105n,&n);s=countValue(n);fprintf(wf,H%f

106",s);)fclose(fp);fclose(wf)a

107ਭ⚪23(+ᦪ¥¦⚪)§ᙠᦻ.in.datCᨵN(ᦪ<200)+ᦪ!ᦪreaddat஺/0¨N+ᦪ2Cᐭᦪ©xx஺Dᑴᦪcalvalue஺!ᐸhi⌕j=1ஹj¨N+ᦪḄᙳ)avera2ஹᑖqj¨N+ᦪḄ᦮ᦪ>ᑖIsumint{mᦪ>ᑖIsumdec,ᨬ63ᵨᦪwritedat()7ᡠjḄ89$ᑮᦻ.out.dat஺;<=>ᑖ@AB஺DEᦋGHᦪmain஺ஹ/ᦪpᦪreaddat஺I$ᦪpᦪwritedat஺ḄᑁO஺#include#include#defineMAXNUM200floatxx[MAXNUMl;intN=0;/*ᦻ.IN.DATᐳᨵ¯°+ᦪ*/doubleaver=0.0;/*ᙳ)*/doublesumint=0.0;/*᦮ᦪ>ᑖI*/doublesumdec=0.0;/*mᦪ>ᑖI*/intReadDat(void);voidWriteDat(void);voidCalValue(void){inti;for(i=0;i

108");return;)Calvalue();printf("ᦻ.IN.DATᐳᨵ+ᦪ=%d

109",N);printf("ᙳ)=%.21f

110",aver);

111printf("᦮ᦪ>ᑖId%.21f

112”,sumint);printf("mᦪ>ᑖI=%.21f

113",sumdec);WriteDat();system(upausen);intReadDat(void)(HLE*fp;inti=0;if<(fp=fopen("in.dat",nrn))==NULL)return1;while(!feof(fp)){fscanf(fp,u%da\&xx[i++]);}fclose(fp);return0;)voidWriteDat(void)(FILE*fp;fp=fopen(nOUT.DAT","w");fprintf(fp,"%.21f

114%.21f

115%.21f

116",aver,sumint,sumdec);fclose(fp);)ਮ⚪24(id16·ᐰxᦪ⚪)yᑡABprogl.cḄhi*=ᙠe¹᦮ᦪ(100º999)»¼ᔠᩩ.Ḅ᦮ᦪ2¿,mᑮᜧCᐭᦪ©aKÀ*·ᐰxᦪ!Á*1¹ᦪÂ!᝞144ஹ676Ã஺Dᑴᦪ+Ähi!ÅÆᩩ.Ḅ᦮ᦪḄᦪÇÈᡠᑴḄᦪ'(஺ᨬ63ᵨᦪwriteDat()789$ᑮᦻ.out.dat஺DEᦋGHᦪmain஺IᑏᦪwriteDal஺ḄᑁO஺#includeintjsValue(intbb[]){inti,j,k=O;inthun,ten,data;for(i=100;i<=999;i++){j=10awhile(j*j<=i){if(i==j*j){hun=i/100;data=i%100/10;ten=i%10;

117if(hun==tenllhun==datallten==data)bb[k++]=i;)j++;}}returnk;main()(intb[20],num;num=jsValue(b);writeDat(num,b);)writeDat(intnum,intb[])(FILE*out;inti;out=fopen(,'out.dat,,,',w");printf("Éd

118”,num);fprintf(out,M%d

119n,num);for(i=0;i

120,,,bfi]);fprintf(out,',%d

121",b[i]);}fclose(out);)bc=intjsValue(intbb[J){intij,cnt=O,bw,sw,gw;for(i=100;i<=999;i++){bw=i/100;sw=i%100/10;gw=i%10;for(j=10;j*j<=i;j++)if(i==j*j&&(bw==swllsw==gwllgw==bw))bbfcnt++]=i;)returnent;)ਭਮ⚪25((ᦻᦪ⚪)yᑡABḄhi*=»¼2$11º999ÊḄᦪm,KÅÆm,m2Im3ᙳ(ᦻᦪ஺ᡠË(ᦻᦪ*ᢣᐸᔜ¹ᦪÎÏÐḄ᦮ᦪ!᝞121,676,94249Ã஺ÅÆÑÒᩩ.Ḅᦪm=ll,m2=121,m3=1331Ḇ(ᦻᦪ஺Dᑴᦪintsvalue(longm)+Ähi,᝞9*(ᦻᦪ!ᑣᦪ'(1,Ôᑣ'(0஺ᨬ6789$ᑮᦻ.஺ut.dat஺

122;<=>ᑖ@AB஺DEᦋGHᦪmain஺ḄᑁO஺#includeinijsValue(longn){inti,strl,half;charxy[20];ltoa(n,xy,10);/*;<¨ÕiÖᵨitoa()ᦪ!×n*longØḄ*/strl=strlen(xy);half=strl/2;for(i=0;i=half)return1;elsereturn0;Imain(){longm;FILE*out;out=fopen("out.datn,"w");for(m=11;m<1(XX);m++){if(jsValue(m)&&jsValue(m*m)&&jsValue(m*m*m)){printf("m=%41d,m*m=%61d,m*m*m=%8kl

123",m,m*m,m*m*m);fprintf(out,,,m=%41d,m*m=%61d,m*m*m=%81d

124”,m,m*m,m*m*m);))fclose(out);system("pause");}ᡈὅÛ☢Ḅbc=intjsValue(longn){longints=0,k;k=n;while(k){s=s*10+k%10;k/=10;}if(s==n)return1;if(s!=n)return0;)$89:

125m=1l,m*m=121,m*m*m=1331m=101,m*m=10201,m*m*m=1030301m==12321,m*m*m=1367631ਭ⚪26(id37᦮ᦪ¥¦⚪)§ᙠᦻ.IN.DATCᨵVW(ᦪீ200)f¹ᦪḄÞ᦮ᦪ!ᦪReadDat஺/0¨VWÞ᦮ᦪ2Cᐭᦪ©xx஺DᑴᦪCalValueO,ᐸhi⌕j=1ஹj¨ᦻ.ᐳᨵ¯°Þ᦮ᦪtotNuma2ஹj¨ßᦪÏà1¹6!áâḄᦪ*ᏔᦪḄᦪḄᦪtotCnt,{ÅÆÄᩩ.Ḅ¨ßᦪ(ÏàäḄ))Ḅ¦åᙳ)totPjz,ᨬ63ᵨᦪwriteDat()7ᡠjḄ89$ᑮᦻ.OUT.DAT஺>ᑖ@ABCᙠᦻ.prog1.c஺DEᦋGHᦪmain஺ஹ/ᦪReadDat஺IᑏᦪwriteDat஺ḄᑁO஺#include#include#defineMAXNUM200intxx[MAXNUM];inttotNum=0;/*ᦻ.IN.DATᐳᨵ¯°Þ᦮ᦪ*/inttotCnt=0;/*ᔠᩩ.ḄÞ᦮ᦪḄᦪ*/doubletotPjz=0.0;/*ᙳ)*/intReadDat(void);voidwriteDat(void);voidCalValue(void){inti,data;for(i=0;i0){totNum++;data=xx[ij»l;if(data%2==0){totCnt++;totPjz+=xx[i];})if(totCnt==0)totPjz=0;elsetotPjz/=totCnt;}voidmain()(inti;clrscr();for(i=0;i

126");return;

127CalValueO;printfæ"ᦻ.IN.DATᐳᨵÞ᦮ᦪd%dj

128”,totNum;printfæ"ᔠᩩ.ḄÞ᦮ᦪḄᦪ=%d

129”,totCnt;printfæ"ᙳ)=%.2f

130௃otPjz;writeDat;intReadDat(void)(FILE*fp;inti=0;if((fp=fopen(,,IN.DAT"a,r"))==NULL)return1;while(!feof(fp)){fscanf(fp,M%d,",&xx[i++]);)fclose(fp);return0;)voidwriteDat(void)(FILE*fp;fp=fopen("OUT.DAT","wH);fprintf(fp,H%d

131%d

132%6.2f

133n,totNum,totCnt,totPjz);fclose(fp);}ਭ⚪27(id57᦮ᦪᔜ¹ᦪ¥¦⚪)§ᦪpᦻ.in.datCᨵ300f¹ᦪ!23ᵨ/ᦪReadDat஺7¨ßᦪCᐭᦪ©a!DᑴᦪjsValue஺!ᐸhi*=jᓟ¹ᦪÑḄᦪéê¹ᦪÑḄᦪéÛ¹ᦪÑḄᦪé¹ᦪÑḄᦪᜧlëḄᦪent,ì7ᡠᨵÅÆÄᩩ.Ḅf¹ᦪ¿Cᐭᦪ©b!ᯠ6ᦪ©bḄf¹ᦪᢥ,mᑮᜧḄîBï᣸B!ᨬ63ᵨᑏᦪwriteDat஺789$ᑮout.datᦻ.஺᝞=9123,9-1-2-3>0,ᑣᦪÅÆᩩ.Cᐭᦪ©b,sᦪcnt=cnt+l஺9812,9-8-1-2>0,ᑣᦪÅÆᩩ.ñᶍ஺>ᑖ@ABCᙠᦻ.progl.c஺AB#oᦪ©:a[300],b[300],#oóô=entDEᦋGH:ᦪmain஺ஹ/ᦪReadDat஺IᑏᦪwriteDat()ḄᑁO஺#includeinta[300J,b[300j,cnt=0;jsValue

134{inti,j,qw,bw,sw,gw;for(i=0;i<300;i++){qw=a[i]/l000;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;ibfj]){qw=b[i];bfi]=b[j];b[j]=qw;})main()(inti;readDat();jsValue();writeDat();printf("cnt=%d

135",cnt);for(i=0;i

136,\i,b[i]);)readDat()(FILE*fp;inti;fp=fopen(,'in.dat,,,,'ru);for(i=0;i<300;i++)fscanf(fp,"%d,H,&a[i]);fclose(fp);}writeDat()(FILE*fp;inti;fp=fopen("out.dat",,,wn);fprintf(fp,"%d

137",cnt);for(i=0;i

138,,»b[i]);fclose(fp);)ਭ⚪28(id138᦮ᦪᔜ¹ᡭᦣ©ᔠ¥¦⚪)§ᦪpᦻ.IN.DATCᨵ200f¹ᦪ!23ᵨ/ᦪreadDat()7¨ßᦪCᐭᦪ©a!Dὃâᑴ--ᦪjsVal(),ᐸhi*=7ᓟ¹ᦪIÛ¹ᦪø©ᡂḄÛ¹ᦪ

139ab(ᓝ¹ᦪḄᓝ¹ᦪ*]f¹ᦪḄᓟ¹ᦪ!ᓝ¹ᦪḄ¹ᦪ*]f¹ᦪḄᓝ¹ᦪ)!{7¹ᦪIê¹ᦪ©ᡂ•Ḅᓝ¹ᦪcd(ᓝ¹ᦪḄᓝ¹ᦪ*]f¹ᦪḄ¹ᦪ!ᓝ¹ᦪḄ¹ᦪ*]f¹ᦪḄê¹ᦪ)!᝞9©ᡂḄ1ᓝ¹ᦪab-cd>=0sab-cd<=10s1ᦪᙳ*᜻ᦪ!u1ᦪḄᓝ¹ᦪᙳë!ᑣýÅÆÄᩩ.Ḅf¹ᦪᢥ,ᜧᑮmḄîBCᐭᦪ©b!2⌕¦ÅÆÑÒᩩ.Ḅf¹ᦪḄᦪent஺ᨬ6main஺ᦪ3ᵨᑏᦪwriteDat()789ent{ᦪ©bᔠᩩ.Ḅf¹ᦪ$ᑮOUT.DATᦻ.஺;<=>ᑖ@ABCᙠᦻ.progl.c஺AB#oᦪ©:a[200],b[200],#oóô=entDEᦋGᦪpᦻ.IN.DATḄLMᦪp•ஹHᦪmain஺ஹ/ᦪreadDat஺IᑏᦪwriteDat஺ḄᑁO஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsValO{inti,j,thou,hun,ten,data,ab,cd;for(i=0;i<200;i++){thou=afi]/1000;hun=a[i]%1000/100;ten=a[i]%100/10;data=a[i]%10;ab=10*thou+ten;cd=10*data+hun;if((ab-cd)>=O&&(ab-cd)<=10&&ab%2==1&&cd%2==1&&ab>=10&&cd>=10)b[cnt++]=a[i];}for(i=0;i

140”,ent);

141for(i=0;i

142n);writeDat();)writeDat()(FILE*fp;inti;fp=fopenCouLdat","wu);fprintf(fp,"%d

143",ent);for(i=0;i

144",b[i]);fclose(fp);}ਭ⚪29(id139᦮ᦪᔜ¹ᡭᦣ©ᔠ¥¦⚪)§ᦪpᦻ.IN.DATCᨵ200f¹ᦪ!23ᵨ/ᦪreadDat()7¨ßᦪCᐭᦪ©a!DὃâᑴᦪjsVal(),ᐸhi*=7ᓟ¹ᦪIᓝ¹ᦪø©ᡂḄᓝ¹ᦪab(ᓝ¹ᦪḄᓝ¹ᦪ*]f¹ᦪḄᓟ¹ᦪ!ᓝ¹ᦪḄ¹ᦪ*]f¹ᦪḄᓝ¹ᦪ)!{7¹ᦪIê¹ᦪ©ᡂḄᓝ¹ᦪcd(ᓝ¹ᦪḄᓝ¹ᦪ*]f¹ᦪḄ¹ᦪ!ᓝ¹ᦪḄ¹ᦪ*]f¹ᦪḄê¹ᦪ)!᝞9©ᡂḄ1ᓝ¹ᦪab-cd>=10sab-cd<=20s1ᦪᙳ*Ꮤᦪ!u1ᦪḄᓝ¹ᦪᙳë!ᑣýÅÆÄᩩ.Ḅf¹ᦪᢥ,ᜧᑮmḄîBCᐭᦪ©b!2⌕¦ÅÆÑÒᩩ.Ḅf¹ᦪḄᦪentoᨬ6main஺ᦪ3ᵨᑏᦪwriteDat()789ent{ᦪ©bᔠᩩ.Ḅf¹ᦪ$ᑮOUT.DATᦻ.஺;<=>ᑖ@ABCᙠᦻ.progLc஺AB#oᦪ©:a[200],b[200],#oóô=entDEᦋGᦪpᦻ.IN.DATḄLMᦪpஹHᦪmain஺ஹ/ᦪreadDat஺IᑏᦪwriteDat஺ḄᑁO஺#include#defineMAX200inta[MAXl,b[MAX],ent=0;voidjsVal(){inti,j,qw,bw,sw,gw,ab,cd;for(i=0;i=10&&ab-cd<=20&&ab%2==0&&cd%2==0&&qw!=0&&gw!=0)b[cnt++]=a[i];)for(i=0;i

145for(j=i+l;j

146”,ent);for(i=0;i

147M);writeDat();writeDat()(FILE*fp;inti;fp=fopen(nout.datM,"w',);fprintf(fp,H%d

148",ent);for(i=0;i

149n,b[i]);fclose(fp);)⚪30(id152᦮ᦪ᣸B⚪)§ᦪpᦻ.IN.DATCᨵ200f¹ᦪ!23ᵨ/ᦪreadDat஺7¨ßᦪCᐭᦪ©a!DὃâᑴᦪjsVal(),ᐸhi*=¿,ᦪ©a0f¹ᦪ!᝞9f¹ᦪþÿᦪḄᦪᦪᏔᦪ(ᦪᦪᑣ)ᑣᩩḄᦪentᦪᢥᑮᜧḄ#$%ᐭᦪ'b(ᨬ*ᵨᑏ-ᦪwriteDat()./ent0ᦪ'b(1ᔠᩩḄᦪ3ᑮOUT.DATᦻ(஺6789ᑖ;<$%ᙠᦻprogl.c(஺<$(>?@ᦪ'8a[200],b[200J,>?@AB8entCDᦋFᦪGᦻIN.DAT(ḄHIᦪGஹK-ᦪmain஺ஹL-ᦪreadDat஺Mᑏ-ᦪwriteDat()ḄᑁO஺#include

150#defineMAX200inta[MAX],b[MAX],ent=0;voidjsValO{intij,flag;for(i=0;ib[j]){flag=b[i];b[i]=b|j];bU]=flag;})voidreadDat()(inti;FILE*fp;fp=fopen("in.datH,"r");for(i=0;i

151”,ent);for(i=0;i

152M);writeDat();writeDat()(FILE*fp;inti;fp=fopenC'out.dat","w");fprintf(fp,n%d

153u,ent);for(i=0;i

154",b[i]);fclose(fp);

155ਭ⚪S31(TUid17.᪀WXY⚪)>ZᙠᦻIN,DAT(%ᨵ100\]├_`ab\]├_`aᵫ\]dṹdm(f1g4)\]hime(f1g10)ᓫkdj(᦮g)ᦪBsi(᦮g)mnje(o᦮g)9ᑖ'ᡂ஺ᐸ(8mn=ᓫk*ᦪBYt஺-ᦪReadDat()Lu100├_`a%ᐭ.᪀ᦪ'sell(஺Cvᑴ-ᦪSortDat஺ᐸxy⌕{8ᢥmnᜧᑮ|}᣸ᑡmnᑣᢥ\]dṹᜧᑮ|}᣸ᑡᨬ᣸ᑡ./%ᐭ.᪀ᦪ'sell(ᨬ*ᵨ-ᦪWriteDatO./3ᑮᦻOUT4.DAT(஺9ᑖ;<$%ᙠᦻprogl.c(஺CDᦋFK-ᦪmain()ஹLᦪG-ᦪReadDat()M3ᦪG-ᦪWriteDatOḄᑁO஺#include#include#include#include#include#defineMAX100typedefstruct(chardm[5];/*\]dṹ*/charmc[U];/*\]hi*/intdj;/*ᓫk*/intsi;/*ᦪB*/longje;/*mn*/}PRO;PROsell[MAXJ;voidReadDat();voidWriteDatO;voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+1;j<100;j++)if(sell[i].je

156voidReadDat()(FILE*fp;charstr[80],ch[U];inti;fp=fopen("IN.DAT",ur,');for(i=0;i

157",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,n%s%s%4d%5d%5d

158M,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਮ⚪S32(TUid79.᪀WXY⚪)>ZᙠᦻIN.DAT(%ᨵ100\]├_`ab\]├_`aᵫ\]dṹdm(f1g4)\]hime(f1g10)ᓫkdj(᦮g)ᦪBsi(᦮g)mnje(o᦮g)9ᑖ'ᡂ஺ᐸ(8mn=ᓫk*ᦪBYt஺-ᦪReadDat஺Lu100├_`a%ᐭ.᪀ᦪ'sell(஺Cvᑴ-ᦪSorlDat(),ᐸxy⌕{8ᢥ\]hiᜧᑮ|}᣸ᑡ\]hiᑣᢥmnᑮᜧ|}᣸ᑡᨬ᣸ᑡ./%ᐭ.᪀ᦪ'sell(ᨬ*ᵨ-ᦪWriteDat஺./3ᑮᦻOUT7.DAT(஺9ᑖ;<$%ᙠᦻprogl.c(஺CDᦋFK-ᦪmain஺ஹLᦪG-ᦪReadDat()M3ᦪG-ᦪWriteDat()ḄᑁO஺

159#include#include#include#include#include#defineMAX100typedefstruct)chardm[5];/*\]dṹ*/char\]hi*/intdj;/*ᓫk*/intsi;/*ᦪB*/longje;/*mn*/}PRO;PROsellfMAX];voidReadDat();voidWriteDat();voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+l;jsell[j].je){xy=sell[i];sell[i]=sellfj];sell[j]=xy;})voidmain(){memset(sell,0,sizeof(sell));ReadDat();SoilDat();WriteDat();)voidReadDat()(FILE*fp;charstr[80],ch[ll];inti;fp=fopen("IN.DAT",T);for(i=0;i<100;i++){fgets(str,80,fp);

160memcpy(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);)voidWriteDat()(HLE*fp;inti;fp=fopen(',OUT7.DAT',,w");for(i=0;i<100;i++){printf(n%s%s%4d%5d%5d

161H,sell[i].dm,seU[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,H%s%s%4d%5d%5d

162H,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਭ⚪S33(TUid61XY⚪)Cvᑴ-ᦪReadDat஺ᦻIN.DAT(Lu1000ᓝ|ᑴ᦮ᦪᑮᦪ'xx(Cvᑴ-ᦪCompute஺ᑖYxx(ᏔᦪḄᦪeven,᜻ᦪḄᙳave1,ᏔᦪḄᙳave20totfcḄᨬ*ᵨ-ᦪWriteDat஺./3ᑮOUT.DATᦻ(஺YḄ᝞8N2totfc=l/NE(xx[i]-ave2)i=lNᏔᦪḄᦪxx[i]Ꮤᦪave2ᏔᦪḄᙳ஺ᦪGᦻ%Ḅ8b}%10ᦪᵨ⌹◞¡஺(bᦪᙳᜧ02000)9ᑖ;<$%ᙠᦻprogl.c(஺CDᦋFK-ᦪmain஺M3ᦪG-ᦪwriteDat஺ḄᑁO஺#include#include#include#defineMAX1000intxx[MAX],odd=0,even=0;doubleave1=0.0,ave2=0.0,totfc=0.0;

163voidWriteDat(void);intReadDat(void){inti;FILE*fp;if((fp=fopen(,,IN.DAT,(,"ru))==NULL)return1;/*********vᑴ-ᦪRcadDat()Ḅ9ᑖ************/for(i=0;i

164");}fclose(fp);return0;)voidCompute(void){inti,yy[MAX];for(i=0;i

165");return;Compute();printf(MOVEN=%d

166AVE1=%f

167AVER2=%f

168TOTFC=%f

169",even,avel,ave2,totfc);

170WriteDat();voidWriteDat(void)(HLE*fp;inti;fp=fopen("OUT.DAT",uwH);fprintf(fp,,,%d

171%f

172%f

173%f

174",even,avehave2,totfc);fclose(fp);)ਭਮ⚪S34(TUid73,102¤ᦪ⚪)TUid102⚪¥¦§{¤ᦪisPrime()-ᦪ<$progl.cḄxy8⌱100©1000ªᑁᡠᨵᦪf¬ᓝᦪfªM10◀ᡠt¯ᦪា±ᦪfḄ¤ᦪ(᝞293)஺Y3©²¤ᦪḄᦪent0¤ᦪḄMsum஺Cὃ´vᑏ-ᦪcountValue()<$⌕{ᨬ*ᵨ-ᦪwriteDAT஺./entMsum3ᑮᦻbclO.out(஺6789ᑖ;<$%ᙠᦻprogl.c(஺CDᦋFK-ᦪmain()M3ᦪG-ᦪwriteDAT()ḄᑁO஺#includeintent,sum;voidcountValue(){inti,j,bw,sw,gw;for(i=100;i<1000;i++){bw=i/100;sw=i%100/10;gw=i%10;for(j=2;j

175writeDAT()(FILE*fp;fp=fopen(nbcl0.outn,"w");fprintf(fp,"%d

176%d

177",cnl,sum);fclose(fp);)3./8¤ᦪḄᦪ=15ᩩ¤ᦪḄM=6825ਭਮ⚪S35(TUid20·ᦪXY⚪)¸·ᦪḄ¹º⚗Al=l,A2=l,ᔜ⚗ᐹᨵ᝞ᐵ¿8An=An-2+2An-1(68n-2¬n-1᪗)ᑡ<$progl.cḄxy8⌕{ÁÂÃ᦮ᦪM=100,1000M10000{ÃÄḄnÅᐸ8SnvMSn+1>=M,ÆSn=Al+A2+...+An,ÁÂn%ᐭᦪ'ᓫᐗb[0],b[l]Mbফ(CvᑴjsValue஺-ᦪᩭxyᨬ*ᵨ-ᦪwriteDat஺ᦪ'Ê(Ḅ3ᑮout.datᦻ(஺CDᦋFK-ᦪmain஺Mᑏ-ᦪwriteDat஺ḄᑁO஺#includeintb13J;jsValue(){intal=l,a2=l,a12,sn,k=2;sn=al+a2;while(l){a!2=al+2*a2;if(sn<100&&sn+a12>=100)b[O]=k;if(sn<1000&&sn+a12>=1000)b[l]=k;if(sn=10000){b[2]=k;break;}sn=sn+a!2;al=a2;a2=al2;k++;))main()(jsValue();printf("M=100,n=%d

178M=1000,n=%d

179M=10000,n=%d

180H,b[0],b[l],b[2]);writeDat();

181writeDat()(FILE*fp;fp=fopen(,,out.dat',,"wn);printf("%d

182%d

183%d

184,\b[O],b[1],b[2]);fprintf(fp,"%d

185%d

186%d

187",b[0],b[l],b[2]);fclose(fp);)X}./8M=100,n=6M=1000,n=9M=10000,n=llਭਮ⚪S36(TUid5f1Ëᣚ⚪)-ᦪReadDat஺ᦻENG.IN(Lu•ÎÏᦻᦻÐ%ᐭᑮf1Ñᦪ'xx(Cvᑴ-ᦪencryptChar(),ᢥÒ?ḄËdᐵ¿Ãᦪ'xx(Ḅᡠᨵf1|}Ëd%ᐭᦪ'xxḄÃÄḄÓᓃᨬ*ᵨ-ᦪWriteDat஺./xx3ᑮᦻpS6.DAT(஺Ëdᐵ¿8f(p)=p*llmod256(pᦪ'(¸Õf1ḄASCIIf(p)YÖf1ḄASCII)᝞/Yf(p)32ᡈf(p)ÃÄḄf1ᦪf0Ø9,ᑣf1AᔲᑣÚf(p)ᡠÃÄḄf1|}Ëd஺9ᑖ;<$%ᙠᦻprogl.c(஺ᦪGᦻ%Ḅ8b}ḄÛÜᙳ80f1஺CDᦋFK-ᦪmain஺ஹLᦪG-ᦪReadDat()M3ᦪG-ᦪWriteDat஺ḄᑁO஺#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻÐḄÝ}ᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,j;for(i=0;i='0,&&xxliJ|jJ*ll%256<=,9,)continue;elsexx[i]rj]=xx[i][j]*ll%256;)voidmain()

188clrscr();if(ReadDat()){printf("ᦪGᦻENGINyᡭ¡Þ

189\007”);return;)encryptChar();WriteDat();)iniReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(,,engjnM,"rH))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]/

190,);if(p)*p=O;i++)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(',ps6.dat,,»,,wn);for(i=0;i

191,',xx[i]);fprintf(fp,M%s

192",xx[iJ);)fclose(fp);)ᡈßÕàá8voidencryptChar(){inti,j,val;for(i=0;i=,0,&&val<=,9')continue;

193elsexx[i][j]=val;⚪âᨵãäàááåæ⚪8ਮ⚪S37(TUid89f1Ëᣚ⚪)-ᦪReadDat()ᦻENGIN(LuÕÎÏᦻᦻÐ%ᐭᑮf1Ñᦪ'xx(Cvᑴ-ᦪencryplChar஺ᢥÒ?ḄËdᐵ¿Ãᦪ'xx(Ḅᡠᨵf1|}Ëd%ᐭᦪ'xxḄÃÄḄÓ©ᨬ*ᵨ-ᦪWriteDat()./xx3ᑮᦻPS7.DAT(஺Ëdᐵ¿8f(p)=p*llmod256(pᦪ'(¸Õf1ḄASCIIf(p)YÖf1ḄASCII)᝞/f1ᜧᑏfçᡈYf(p)32,ᑣf1AᔲᑣÚf(p)ᡠÃÄḄf1|}Ëd஺9ᑖ;<$%ᙠᦻprogl.c(஺ᦪGᦻ%Ḅ8b}ḄÛÜᙳ80f1஺CDᦋFK-ᦪmain஺ஹLᦪG-ᦪReadDat஺M3ᦪG-ᦪWriteDat஺ḄᑁO஺#include#include#include#includeunsignedcharxxf50][80];intmaxline=0;/*ᦻÐḄÝ}ᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,jfor(i=0;i=,A,&&xx[i]fj]<=,Z')continue;elsexx[i][j]=xx[i][j]*ll%256;)voidmain()(clrscr();if(ReadDat()){printf("ᦪGᦻENGINyᡭ¡Þ

194\007H);return;)encryptChar();WriteDatO;intReadDat(void)

195FILE*fp;inti=0;unsignedchar*p;if((fp=fopen("eng.in'V(ru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],

196*)if(p)*p=O;i++)maxline=i;fclose(fp);return0;}voidWriteDat(void)(FILE*fp;inti;fp=fopen(nps7.datu,nw");for(i=0;i

197”,xx[i]);fprintf(fp,,,%s

198,,,xx[i]);)fclose(fp);)⚪âᨵãäàááåæ⚪8ਭ⚪S38(TUid81.᪀WXY⚪)>ZᙠᦻIN.DAT(%ᨵ100\]├_`ab\]├_`aᵫ\]dṹdm(f1g4)\]hime(f1g10)ᓫkdj(᦮g)ᦪBsi(᦮g)mnje(o᦮g)9ᑖ'ᡂ஺ᐸ(8mn=ᓫk*ᦪBYt஺-ᦪReadDat஺Lu100├_`a%ᐭ.᪀ᦪ'sell(஺Cvᑴ-ᦪSorlDat஺ᐸxy⌕{8ᢥ\]dṹᑮᜧ|}᣸ᑡ\]dṹᑣᢥmnᑮᜧ|}᣸ᑡᨬ᣸ᑡ./%ᐭ.᪀ᦪ'sell(ᨬ*ᵨ-ᦪWriteDat஺./3ᑮᦻOUT6.DAT(஺9ᑖ;<$%ᙠᦻprogl.c(஺CDᦋFK:-ᦪmain஺ஹLᦪG-ᦪReadDat()M3ᦪG-ᦪWriteDat஺ḄᑁO஺#include#include#include#include#include

199#defineMAX100typedefstruct)chardm[5J;/*\]dṹ*/char\]hi*/intdj;/*ᓫk*/intsi;/*ᦪB*/longje;/*mn*/}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>sell[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}voidmain()(memset(sell,0,sizeof(sell));ReadDat();SoilDat();WriteDat();)voidReadDat()(FILE*fp;charstr[80],ch[ll];inti;fp=fopen(,,IN.DAT",r,');for(i=0;i

200sell[i].je=(long)sell[i].dj*sell[i].sl;)fclose(fp);)voidWriteDat(void)(FILE*fp;inti;fp=fopen("OUT6.DAT","w");for(i=0;i<100;i++){printf("%s%s%4d%5d%5d

201",sellfi].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,"%s%s%4d%5d%5d

202",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਭਮ⚪S39(TUid63⌱ἠê⚪)ᨵÕ10ë100}Ḅ⌱ἠᦪGᦻIN.DAT,ᐸᦪG%Ḅbᩩ`aḄoÜᙳ10ìÕ⊤îìÕëḄ⌱(ïðìµ⊤îìµëḄ⌱(ïðÁñò8ᑁOᙳf10M11⊤îë⌱(0⊤îëó⌱(ᐰ⌱ᡈ⌱ᙳTᦔḄ⌱ἠ஺Ò?-ᦪReadDat()Ḅxy⌱ἠᦪGLᐭᑮf1Ñᦪ'xx(஺Cvᑴ-ᦪCountRs஺ᩭbëḄ⌱ἠᦪtἠᦪÁÂ%ᐭyy[0᎔yy[9](஺./yy3ᑮᦻOUT.DAT(஺9ᑖ;<$%ᙠᦻprogl.c(஺CDᦋFK-ᦪmain஺ஹLᦪG-ᦪReadDat()M3ᦪG-ᦪwriteDat()ḄᑁO஺#includecharxx[100Jll1];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[ij[j]=='r)count++;if(count==0llcount==10)continue;for(j=0;j<10;j++)if(xx[i]U]==r)yy|j]++;

203voidmain()inti;for(i=0;i<10;i++)yy[i]=O;if(ReadDat()){printf("⌱ἠᦪGᦻIN.DATyᡭ¡Þ

204\007)return;}CountRs();WriteDatO;intReadDat(void)(FILE*fp;inti;if((fp=fopen(nIN.DATV'ru))==NULL)return1;for(i=0;i<100;i++){if(fgets(xx[ij,11,fp)==NULL)return1;xx[i][10]=W;)fclose(fp);return0;}voidWriteDat(void)(FILE*fp;inti;fp=fopen("OUT.DAT,,,',wM);for(i=0;i<10;i++){fprintf(fp,"%d

205",yy[i]);printf("ìødëḄ⌱ἠᦪ=%d

206\i+l,yy[i]);fclose(fp);

207ਭ⚪S40(TUid43᦮ᦪXY⚪)ùZᙠᦻIN.DAT(%ᨵú(ᦪ<200)ᦪfḄû᦮ᦪ-ᦪReadDat஺Luúû᦮ᦪ%ᐭᦪ'xx(஺Cvᑴ-ᦪCalValue(),ᐸxy⌕{8Iஹ{ᦻ(ᐳᨵäýû᦮ᦪtotNum2ஹ{ᦪ(ḄᔜᦪfªMᏔᦪḄᦪḄᦪtotCnt,0ᩩḄᦪḄYþᙳtotPjz,ᨬ*ᵨ-ᦪwriteDat஺ᡠ{Ḅ./3ᑮᦻOUT.DAT(஺9ᑖ;<$%ᙠᦻprog1.c(஺CDᦋFK-ᦪmain஺ஹL-ᦪReadDat஺Mᑏ-ᦪwriteDat஺ḄᑁO஺#include#include#defineMAXNUM200intxx[MAXNUM];inttotNum=0;/*ᦻIN.DAT(ᐳᨵäýû᦮ᦪ*/inttotCnt=0;/*1ᔠᩩḄû᦮ᦪḄᦪᑡdoubletotPjz=0.0;/*ᙳ*/intReadDat(void);voidwriteDat(void);voidCalValue(void){inti,qw,bw,sw,gw;for(i=0;i0){totNum++;qw=xx[iJ/1000;bw=xx[i]/100%10;sw=xx[ij%100/10;gw=xx[i]%10;if((qw+bw+sw+gw)%2==0){totCnt++;totPjz+=xx[iJ;})if(totCnt==0)totPjz=0;elsetotPjz/=totCnt;)voidmain()(inti;clrscr();for(i=0;i

208printf("ᦪGᦻIN.DATyᡭ¡!\007

209)return;)CalValueO;printf("ᦻIN.DAT(ᐳᨵû᦮ᦪµ%dprintf("1ᔠᩩḄû᦮ᦪḄᦪ=%d

210”,totCnt);primf("ᙳ=%.2An௃otPjz);wrileDat();intReadDat(void)(FILE*fp;inti=0;if((fp=fopen("IN.DAT'Vru))==NULL)return1;while(!feof(fp)){fscanf(fp,,,%d,",&xx[i++]);)fclose(fp);return0;)voidwriteDat(void)(FILE*fp;fp=fopen("OUT.DAT,',',wH);fprintf(fp,n%d

211%d

212%6.2f

213u,totNum,totCnt,totPjz);fclose(fp);}ਭਮ⚪41(id51SIX/NINE⚪)ᑡprogl.cḄᯠᦪSIXNINE,ḄᩩSIX+SIX+SIX=NINE+NINEḄᦪent!"#ᩩᡠᨵḄSIX&NINEḄSUM஺()ᑏ+ᦪcountValue(),-Ḅ⌕/ᨬ12ᵨ+ᦪwriteDat஺456entsum,7ᑮᦻOUT15.DAT;஺ᐸ;ḄS,I,X,N,Eᔜ>⊤@ᓝBᑴᦪD஺EᑖGHᙠᦻprogl.c;஺(JᦋLM:+ᦪmain஺7ᦪO+ᦪwrileDat஺ḄᑁQ஺#includeintent,sum;voidcountValue()

214{ints,i,x,n,e,six,nine;for(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*1OOO+i*l00+n*10+e;if(3*six==2*nine){cnt++;sum+=six+nine;}))voidmain()(cnt=sum=0;countValue();printf("ᩩḄᦪ=%m1”,cnt);printf("ᩩᡠᨵḄSIX&NINEḄU%d

215”,sum);writeDat();)writeDat()(FILE*fp;fp=fopen("OUT15.DAT',V,wH);fprintf(fp,"%d

216%d

217H,cnt,sum);fclose(fp);)W@XYᐺ[\voidcountValue(){inti;for(i=666;i<=999;i=i+2)if((i/10%10==(3*i/2)/100%10)&&((3*i/2)/1000==(3*i/2)%100/10)){cnt++;sum+=i+3*i/2;})]56^ᩩḄᦪ=4ᩩᡠᨵḄSIX&NINEḄ=9430

218⚪425᪀`]⚪aᓭc12@᪵e“ghᑮᜧ”ᦋᡂl“gᜧᑮh”mnᙠᦻIN.DAT;Hᨵ100op├rstuop├rstᵫop>ṹdm(Dxy4z)op{|me(Dxy10z)ᓫ~dj(᦮y)ᦪsi(᦮y)je(᦮y)Eᑖᡂ஺ᐸ;=ᓫ~*ᦪ஺+ᦪReadDatO100├rstHᐭ5᪀ᦪsell;஺()ᑴ+ᦪSortDat(),ᐸ⌕/ᢥop{|gᜧᑮhB᣸ᑡop{|ᑣᢥgᜧᑮhB᣸ᑡᨬ᣸ᑡ56Hᐭ5᪀ᦪsell;ᨬ12ᵨ+ᦪWriteDat஺4567ᑮᦻOUT5.DAT;஺EᑖGHᙠᦻprogl.c;஺(JᦋLM+ᦪmain஺ஹᦪO+ᦪReadDatO7ᦪO+ᦪWrileDat஺ḄᑁQ஺#include#include#include#include#include#defineMAX100typedefstruct{chardm[5J;/*op>ṹ*/charop{|*/intdj;/*ᓫ~intsi;/*ᦪ*/longje;/**/}PRO;PROsell[MAX];voidReadDatO;voidWriteDat();voidSortDat(){inti,jVPROxy;for(i=0;i<99;i++)for(j=i+l;j

219voidReadDat()(FILE*fp;charstr[8O],ch[l1];inti;fp=fopenCIN.DATnV,rn);for(i=0;i<100;i++){fgets(str,8O,fp);memcpy(sellfi].dm,str,4);memcpy(sell[i].mc,str+4,10);memcpy(ch,str+l4,4)Vch[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=fopen(',OUT5.DATH,uw,');for(i=0;i<100;i++){printf(H%s%s%4d%5d%5d

220M,sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,M%s%s%4d%5d%5d

221",sellliJ.dm,sell[iJ.mc,sellLiJ.dj,sellLiJ.sl,sell[iJ.je);)fclose(fp);ਮ⚪43id82Dx᣸⚪id82⚪e56ᢥ“gᜧᑮh”᣸+ᦪReadDal஺,-gᦻin.dat;20ᦪOHᑮDxᦪxx;uDxᙳh80஺()ᑴ+ᦪjsSort,ᐸ+ᦪḄ!^ᓫzDx¡Ḅ᪗^᜻ᦪḄDxᢥᐸASCII¤ghᑮᜧḄ¥B᣸᣸1Ḅ56ᢥ¦§HᐭDxᦪxx;ᨬ12ᵨ+ᦪWriteDat456xx7ᑮᦻout.dat;஺¨᝞zª01234567GDxabcdefghᑣᜐᳮ1Dxahcfedgb

222EᑖGHᙠᦻprogl.c;஺(JᦋLM+ᦪmain஺ஹᦪO+ᦪReadDat()7ᦪO+ᦪWriteDat()ḄᑁQ஺#include#include#includecharxx[20][80];voidjsSort(){inti,j,k,strl;charch;for(i=0;i<20;i++){strl=strlen(xx[i]);for(j=l;jxx[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",nr");while(i<20&&fgets(xx[i],80,in)!=NULL){p=strchr(xx[i]/

223*);if(p)*p=O;i++V}fclose(in);writeDat()

224FILE*out;inti;out=fopen(,'out.dat",',wn);clrscr();for(i=0;i<20;i++){printf("%s

225”,xx[i]);fprintf(out,M%s

226'\xx[i]);)fclose(out);}⚪44(id4Dx®᣸¯ᣚ⚪)+ᦪReadDat஺,-gᦻin.dat;20ᦪOHᑮDxᦪxx;(uDxᙳh80)஺()ᑴ+ᦪjsSort(),ᐸ+ᦪḄ!^ᓫzDxᢥ±²ḄᩩB᣸᣸1Ḅ56ᢥ¦§HᐭDxᦪxx;ᨬ12ᵨ+ᦪWriteDat஺456xx7ᑮᦻout.dat;oᩩgDx;³•ᑖ^UµEᑖᢥDxḄASCII¤¶᣸᣸1µEᑖ&®µEᑖB¯ᣚ஺᝞6·Dx^᜻ᦪᑣᨬ;³ḄDx¸¹ºᜐᳮDxᙠ·zª»஺¨᝞zª012345678GDxabedhgfe123498765ᑣᜐᳮ1Dxhgfedcba876594321EᑖGHᙠᦻprogl.c;஺(JᦋLM+ᦪmain஺ஹᦪO+ᦪReadDat஺7ᦪO+ᦪWriteDat()ḄᑁQ஺#include#include#includecharxx[20][80];voidjsSort(){inti,j,k,strl,half;chartemp;for(i=0;i<20;i++){strl=strlen(xxlij);half=strl/2;for(j=0;j=O;j-,k-)

227{temp=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=temp;}voidmain()(readDat();jsSort();writeDat();)readDat()(FILE*in;inti=0;char*p;in=fopen(,,in.dat"V,rn);while(i<20&&fgets(xx[i],80,in)!=NULL){p=strchr(xx[i]/

228*);if(p)*p=O;i++V}fclose(in);)writeDat()(FILE*out;inti;clrscr();out=fopen("out.dat",Hwn);for(i=0;i<20;i++){printf("%s

229",xx[i]);fprintf(out,n%s

230'\xx[i]);)fclose(out);)⚪45(id154ᦪD¼᣸⚪)mnᦪOᦻIN.DAT;Hᨵ200½zᦪm2ᵨ+ᦪreadDat஺4¾ᦪHᐭᦪa;(ὃÀ)ᑴ@+ᦪjsVal(),ᐸÁÂgᦪa;@½zᦪ᝞6ýzᦪÄÅᜧýzᦪ!ÆḄᦪÇÃᦪᏔᦪ(ýzᦪ!Ƹᦪᑣ¸¼)ᑣ

231¼#ᩩḄᦪent4¾½zᦪᢥgᜧᑮhḄ¥Hᐭᦪb;ᨬ12ᵨᑏ+ᦪwriteDat()456ent!"ᦪb;xᔠᩩḄ½zᦪ7ᑮOUT.DATᦻ;஺ÊËEᑖGHᙠᦻprogl.c;஺;m²Ìᦪ:a[200],b[200],m²Ì¡ent(JᦋLᦪOᦻIN.DAT;ḄÍÎᦪOஹM+ᦪmain஺ஹ+ᦪreadDat஺ᑏ+ᦪwriteDat()ḄᑁQ஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsVal(){inti,j,flag;for(i=5;ia[j]&&a[i]%2==0)flag=l;else{flag=O;break;}if(flag==l)b[cnt++]=a[i];)for(i=0;i

232”,ent);for(i=0;i

233n);writeDat();

234writeDat()(FILE*fp;inti;fp=fopen(nout.datn,"wu);fprintf(fp,n%d

235",ent);for(i=0;i

236M,b[i]);fclose(fp);)ਭਮ⚪46(id153ᦪD¼᣸⚪)mnᦪOᦻIN.DAT;Hᨵ200½zᦪm2ᵨ+ᦪreadDat஺4¾ᦪHᐭᦪa;(ὃÀ)ᑴ@+ᦪjsVal(),ᐸÁÂgᦪa;@½zᦪ᝞6ýzᦪÄÅᜧýzᦪ!ÆḄᦪÇÃᦪ᜻ᦪÇÃᦪÏÐÑ7᦮◀(ýzᦪ!Ƹᦪᑣ¸¼)ᑣ¼#ᩩḄᦪent4¾½zᦪᢥgᜧᑮhḄ¥Hᐭᦪb;ᨬ12ᵨᑏ+ᦪwriteDat()456ent!"ᦪb;xᔠᩩḄ½zᦪ7ᑮOUT.DATᦻ;஺ÊËEᑖGHᙠᦻprogl.c;஺;m²Ìᦪ:a[200],b[200],m²Ì¡ent(JᦋLᦪOᦻIN.DAT;ḄÍÎᦪOஹM+ᦪmain஺ஹ+ᦪreadDat஺ᑏ+ᦪwriteDat()ḄᑁQ஺#include#defineMAX200inta[MAXJ,b[MAXJ,ent=0;voidjsVal(){inti,j,flag;for(i=5;ia|jJ&&aLij%2&&ali]%7==0)flag=1;else{flag=O;break;}if(flag==l)b[cnt++]=a[i];)for(i=0;i

237fclose(fp);voidmain()(inti;readDat();jsVal();printf("ᩩḄᦪ=%d

238”,ent);for(i=0;i

239");writeDat();writeDat()(FILE*fp;inti;fp=fopen("out.datH,nwu);fprintf(fp,n%d

240",ent);for(i=0;i

241",b[i]);fclose(fp);)ਮ⚪47(id765᪀`]⚪)mnᙠᦻIN.DAT;Hᨵ100op├rstuop├rstᵫop>ṹdm(Dxy4z)op{|me(Dxy10z)ᓫ~dj(᦮y)ᦪsi(᦮y)je(᦮y)Eᑖᡂ஺ᐸ;=ᓫ~*ᦪ஺+ᦪReadDat஺100├rstHᐭ5᪀ᦪsell;஺()ᑴ+ᦪSortDat஺ᐸ⌕/ᢥgᜧᑮhB᣸ᑡᑣᢥop>ṹghᑮᜧB᣸ᑡᨬ᣸ᑡ56Hᐭ5᪀ᦪsell;ᨬ12ᵨ+ᦪWriteDat஺4567ᑮᦻOUT3.DAT;஺EᑖGHᙠᦻprogl.c;஺(JᦋLM+ᦪmain஺ஹᦪO+ᦪReadDat()7ᦪO+ᦪWriteDat஺ḄᑁQ஺#include#include#include#include#include#defineMAX100typedefstruct{chardm[5];/*op>ṹ*/charop{|*/

242intdj;/*ᓫ~*/intsi;/*ᦪ*/longje;/**/}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){intij;PROxy;for(i=0;i<99;i++)for(j=i+l;j<100;j++)if(sell[i].jeO){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}Ivoidmain()(memset(sell,0,sizeof(sell));ReadDat();SortDat();WriteDat();)voidReadDat()(FILE*fp;charstr[8O],ch[ll];inti;fp=fopen(,,IN.DATMV,rn);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[ij.dj=atoi(ch);memcpy(ch,str+18,5);ch[5]=0;sell[i].sl=atoi(ch);sell[i].je=(long)sell[i].dj*sell[ilsl;)fclose(fp);

243voidWriteDat()(FILE*fp;inti;fp=fopen(,'OUT3.DAT',,,,w,');for(i=0;i<100;i++){printf("%s%s%4d%5d%5d

244",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprimf(fp,"Ós%s%4d%5d%5d

245",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);}⚪48(id60᦮ᦪᔜzᦪD]⚪)mnᦪOᦻin.dat;Hᨵ300½zᦪm2ᵨ+ᦪReadDat஺4¾ᦪHᐭᦪa;()ᑴ@+ᦪjsValue(),ᐸ/ᓟzᦪ»Ḅᦪºzᦪ»ḄᦪÕzᦪ»Ḅᦪºᓝzᦪ»ḄᦪḄᦪent,Ö4ᡠᨵ#ᩩḄ½zᦪÁÂHᐭᦪb;ᯠ1ᦪbḄ½zᦪᢥghᑮᜧḄ¥B᣸ᨬ12ᵨᑏ+ᦪwriteDat஺4567ᑮout.datᦻ஺¨᝞:6712,6+2=7+1,ᑣÃᦪᩩHᐭᦪb;Çᦪcnt=cnt+h8129,8+901+2,ᑣÃᦪ¸ᩩ×ᶍ஺EᑖGHᙠᦻprogl.c;஺;m²Ìᦪa[300],b[300],m²Ì¡ent(JᦋLM+ᦪmain஺ஹ+ᦪReadDat஺ᑏ+ᦪwriteDat()ḄᑁQ஺#includeinta[300],b[300],cnt=0;jsValue(){inti,qw,bw,sw,gw,j;for(i=0;i<300;i++){qw=a[ij/1000;bw=a[ij%l000/100;sw=a[i]%100/10;gw=a[i]%10;if(qw+gw==bw+sw)b[cnt++J=ali];)for(i=0;ib(j]){qw=b[i];b[i]=b|jjVb[j]=qw;}main()inti;

246readDat();jsValue();writeDat();printf(',cnt=%d

247",cnt);for(i=0;i

248,\i,b[i]);)readDat()(FILE*fp;inti;fp=fopen("in.dat","r");for(i=O;i<3OO;i++)fscanf(fp,"%d,M,&a[i]);fclose(fp);IwriteDatO(FILE*fp;inti;fp=fopen(',out.dat,,/,wn);fprintf(fp,"%d

249",cnt);for(i=0;i

250n,b[i]);fclose(fp);)ਭ⚪49(id33᦮ᦪᔜzᦪD]⚪)mnᦪOᦻin.dat;Hᨵ300½zᦪm2ᵨ+ᦪReadDat஺4¾ᦪHᐭᦪa;()ᑴ@+ᦪjsValueO,ᐸ/ᓟzᦪ»ḄᦪÙÕzᦪÙ»zᦪ»ḄᦪÙzᦪ»ḄᦪᜧÚḄᦪent,Ö/ᡠᨵ#ᩩḄ½zᦪÛᙳ¤pjzl,!"¸#ᩩḄ½zᦪÛᙳ¤pjz2,ᨬ12ᵨᑏ+ᦪwriteDatO4567ᑮout.datᦻ஺¨᝞9123,912-3>0,ᑣÃᦪᩩÛᙳ¤pjzl,Çᦪcnt=cnt+l9812,9-8-1-2<0,oᑣÃᦪ¸ᩩÛᙳ¤pjz2oEᑖGHᙠᦻprogl.c;஺;m²Ìᦪa[300],m²Ì¡cnt,pjzl,pjz2஺(JᦋLM+ᦪmain஺ஹ+ᦪReadDat()ᑏ+ᦪwriteDat()ḄᑁQ஺#includeinta[300],cnt=0;doublepjzl=0.0,pjz2=0.0;jsValue(){inti,qw,bw,sw,gw,n=0;for(i=0;i<300;i++)

251{qw=a[i]/1000;bw=a[i]%1000/100;sw=a[i]%100/10;gw=a[i]%10;if(qw-bw-sw-gw>0){cnt++;pjz1+=a[i];}else{n++;pjz2+=a[i];)}if(cnt==O)pjzl=O;elsepjzl/=cnt;if(n==O)pjz2=0;elsepjz2/=n;)main()(inti;readDat();jsValue();writeDat();printf("cnt=%d

252ᩩḄÛᙳ¤pzjl=%7.2f

253¸ᩩḄÛᙳ¤pzj2=%7.2f

254u,cnt,pjzl,pjz2);)readDat()(FILE*fp;inti;fp=fopen(,'in.dat,,,,'ru);for(i=0;i<300;i++)fscanf(fp,"%d,H,&a[i]);fclose(fp);}writeDat()(FILE*fp;inti;fp=fopen("out.dat",,,wn);fprintf(fp,',%d

255%7.2f

256%7.2f

257,,,cnt,pjzl,pjz2);fclose(fp);)ਭ⚪50(id2Dx®᣸¯ᣚ⚪)+ᦪReadDat஺,-gᦻin.dat;20ᦪOHᑮDxᦪxx;(uDxᙳh80)஺()ᑴ+ᦪjsSort(),ᐸ+ᦪḄ!^ᓫzDxᢥ±²ḄᩩB

258᣸᣸1Ḅ56ᢥ¦§HᐭDxᦪXX;ᨬ12ᵨ+ᦪWriteDat()456xx7ᑮᦻout.dat;஺ᩩgDx;³@ᑖ^UµEᑖᢥDxḄASCII¤ᓣ᣸᣸1µEᑖ&®µEᑖB¯ᣚ஺᝞6·Dx^᜻ᦪᑣᨬ;³ḄDx¸¹ºᜐᳮDxᙠ·zª»஺¨᝞zª012345678GDxdcbahgfe432198765ᑣᜐᳮ1DxhgfeabcdEᑖGHᙠᦻprogl.c;஺(JᦋLM+ᦪmain஺ஹ+ᦪReadDat஺ᑏ+ᦪWriteDat஺ḄᑁQ஺#include#include#includecharxx[20][801;voidjsSort(){inti,j,k,strhhalf;chartemp;for(i=0;i<20;i++){strl=strlen(xx[i]);half=strl/2;for(j=0;jxx[i][k]){temp=xx[ij[jj;xx[i]|jj=xx[i]lk];xx[ijlkj=temp;}for(j=half-1,k=strl-1;j>=O;j—,k—){temp=xx[ij|j];xx[ij[j]=xxlijlkj;xx[ijlkj=temp;}voidmain()readDat();jsSort();writeDat();readDat()FILE*in;inti=0;

259char*p;in=fopen(Hin.dat","rn);while(i<20&&fgets(xx[i],80,in)!=NULL){p=strchr(xx[i];if(p)*p=0;i++V)fclose(in);writeDat()(FILE*out;inti;clrscr();out=fopen(nout.dat","w");for(i=0;i<20;i++){printf("Ós

260“,xx[i]);fprintf(out,n%s

261u,xx[i]);)fclose(out);)⚪51(id134᦮ᦪᔜzᡭᦣᔠ]⚪)ßᨵàá/âᦪ+ᦪisprime(),ãä)ᑴmnᦪOᦻIN.DAT;Hᨵ200½zᦪm2ᵨ+ᦪreadDat()4¾ᦪHᐭᦪa;(ὃÀ)ᑴåᦪjsVal(),ᐸ4ᓟzᦪDᓝzᦪD¦§ᡂ@§Ḅᓝzᦪ(§ᓝzᦪḄᓝzᦪD·½zᦪḄᓟzᦪD§ᓝzᦪḄzᦪD·½zᦪḄᓝzᦪD)!"4zᦪDÕzᦪDᡂW@§Ḅᓝzᦪ(§æzᦪḄ»zᦪD·½zᦪḄzᦪD§ᓝzᦪḄzᦪD·½zᦪḄÕzᦪD)᝞6§ᡂḄçᓝzᦪᙳâᦪǧᦪḄᓝzᦪDᙳ¸^Úᑣe#ᩩḄ½zᦪᢥgᜧᑮhḄ¥Hᐭᦪb;⌕»èᩩḄ½zᦪḄᦪent஺ᨬ1main஺+ᦪ2ᵨᑏ+ᦪwriteDat஺456ent!"ᦪb;xᔠᩩḄ½zᦪ7ᑮOUT.DATᦻ;஺ÊËEᑖGHᙠᦻprogLc;஺;m²Ìᦪa[200],b[200],m²Ì¡ent(JᦋLᦪOᦻIN.DAT;ḄÍÎᦪOஹM+ᦪmain஺ஹ+ᦪreadDat஺ᑏ+ᦪwriteDat()ḄᑁQ஺#include#defineMAX200inta[MAX],b[MAX],ent=0;intisprime(intm){inti;

262for(i=2;i<=m/2;i++)if(m%i==O)return0;return1;)voidjsVal(){inti,j,qw,bw,sw,gw;intab,cd;for(i=0;i<200;i++){qw=a[i]/1000;bw=a[i]%1000/100;sw=a[i]%100/10;gw=a[i]%l0;ab=10*qw+sw;cd=l0*gw+bw;if(isprime(ab)&&isprime(cd)&&ab>=10&&cd>=10)b[cnt++]=a[i];)for(i=0;i

263”,ent);for(i=0;i

264");writeDat();)writeDat()(FILE*fp;inti;

265fp=fopen(nout.datH,Hwu);fprintf(fp,M%d

266u,ent);for(i=0;i

267M,b[i]);fclose(fp);)ਭ⚪52(id135᦮ᦪᔜzᡭᦣᔠ]⚪)mnᦪOᦻIN.DAT;Hᨵ200½zᦪm2ᵨ+ᦪreadDat()4¾ᦪHᐭᦪa;(ὃÀ)ᑴ@+ᦪjsVal(),ᐸ4ᓟzᦪDzᦪD¦§ᡂ@§Ḅᓝzᦪ(§HéᦪḄᓝzᦪD·½zᦪḄᓟzᦪD§æzᦪḄzᦪD·½zᦪḄzᦪD)!"4ÕzᦪDᓝzᦪDᡂW@§Ḅᓝzᦪ(§ᓝzᦪḄᓝzᦪD·½zᦪḄÕzᦪD§ᓝzᦪḄzᦪD·½zᦪḄᓝzᦪD)᝞6§ᡂḄçᓝzᦪᙳ᜻ᦪÇçᓝzᦪ;êëᨵ@ᦪÑ5᦮◀ìíç§ᦪḄᓝzᦪDᙳ¸^Úᑣe#ᩩḄ½zᦪᢥgᜧᑮhḄ¥Hᐭᦪb;⌕»èᩩḄ½zᦪḄᦪent஺ᨬ1main஺+ᦪ2ᵨᑏ+ᦪwriteDat()456ent!"ᦪb;xᔠᩩḄ½zᦪ7ᑮOUT.DATᦻ;஺ÊËEᑖGHᙠᦻprogl.c;஺;m²Ìᦪa[200],b[200],m²Ì¡ent(JᦋLᦪOᦻIN.DAT;ḄÍÎᦪOஹM+ᦪmain஺ஹ+ᦪreadDat()ᑏ+ᦪwriteDat()ḄᑁQ஺#include#defineMAX200inta[MAXJ,b[MAXJ,ent=0;voidjsVal(){inti,thou,hun,ten,dataj;intab,cd;for(i=0;i=10&&cd>=10)b[cnt++]=a[i];)for(i=0;i

268for(i=0;i

269”,ent);for(i=0;i

270n);writeDat();writeDat()(FILE*fp;inti;fp=fopenC'out.dat",nwu);fprintf(fp,H%d

271",ent);for(i=0;i

272",b[i]);fclose(fp);)ਭ⚪53(id57᦮ᦪᔜzᦪD]⚪)mnᦪOᦻin.dat;Hᨵ300½zᦪm2ᵨ+ᦪReadDat஺4¾ᦪHᐭᦪa;()ᑴ@+ᦪjsVahie஺ᐸ/ᓟzᦪ»ḄᦪÙÕzᦪ»ḄᦪÙᓝzᦪ»ḄᦪÙzᦪ»ḄᦪᜧÚḄᦪent,Ö4ᡠᨵ#ᩩḄ½zᦪÁÂHᐭᦪb;ᯠ1ᦪbḄ½zᦪᢥghᑮᜧḄ¥B᣸ᨬ12ᵨᑏ+ᦪwriteDat()4567ᑮout.datᦻ஺¨᝞9123,9-1-2-3>0,ᑣÃᦪᩩHᐭᦪb;Çᦪcnt=cnt+l.9812,9-8-1-2>0,ᑣÃᦪ¸ᩩ×ᶍ஺EᑖGHᙠᦻprogLc;஺;m²Ìᦪ:a[300],b[300],m²Ì¡ent(JᦋLM+ᦪmain஺ஹ+ᦪReadDat()ᑏ+ᦪwriteDat஺ḄᑁQ஺#includeinta[3OO],b[3OO],cnt=O;jsValue(){inti,j,qw,bw,sw,gw;for(i=0;i<300;i++){qw=a[i]/1000;bw=a[i]/100%10;sw=a(ij%100/10;gw=a[i]%10;

273if((qw-bw-sw-gw)>0)b[cnt++]=a[i];)for(i=0;ib[j]){qw=b[i];b[i]=b[j];b|j]=qw;})main()(inti;readDat();jsValue();writeDat();printf(ncnt=%d

274",cnt);for(i=0;i

275,\i,b[i]);)readDat()(FILE*fp;inti;fp=fopen("in.dat",',ru);for(i=0;i<300;i++)fscanf(fp,"%d,",&a[i]);fclose(fp);)writeDat()(FILE*fp;inti;fp=fopen(Mout.dat",',wn);fprintf(fp,n%d

276H,cnt);for(i=0;i

277,',b[i]);fclose(fp);)ਮ⚪54(id58᦮ᦪᔜzᦪ]᣸⚪)mnᦪOᦻin.dat;Hᨵ300½zᦪm2ᵨ+ᦪReadDat஺4¾ᦪHᐭᦪa;()ᑴ@+ᦪjsValueO,ᐸ/ᓟzᦪ»ḄᦪºÕzᦪ»Ḅᦪ»zᦪ»Ḅᦪºzᦪ»ḄᦪḄᦪent,Ö4ᡠᨵ#ᩩḄ½zᦪÁÂHᐭᦪb;ᯠ1ᦪbḄ½zᦪᢥgᜧᑮhḄ¥B᣸ᨬ12ᵨᑏ+ᦪwriteDat஺4567ᑮout.datᦻ஺¨᝞7153,7+1=5+3,ᑣÃᦪᩩHᐭᦪb;,Çᦪcnt=cnt+l஺

2788129,8+102+9,ᑣÃᦪ¸ᩩ×ᶍ஺EᑖGHᙠᦻprogl.c;஺;m²Ìᦪ:a[300],b[300],m²Ì¡ent(JᦋLM+ᦪmain஺ஹ+ᦪReadDat஺ᑏ+ᦪwriteDat஺ḄᑁQ஺#includeinta[300],b[300],cnt=0;jsValue(){inti,j,qw,bw,sw,gw;for(i=0;i<300;i++){qw=a[i]/l000;bw=a[i]/l00%10;sw=a[i]%100/10;gw=a[i]%10;if(qw+bw==sw+gw)b[cnt++l=a[i];)for(i=0;i

279",cnt);for(i=0;i

280,\i,blij);)readDat()(HLE*fp;inti;fp=fopen(',in.dat","ru);for(i=0;i<300;i++)fscanf(fp,"%d,M,&a[i]);fclose(fp);)writeDat()(FILE*fp;inti;fpUfopen("out.dat",“w")V

281fprintf(fp,n%d

282M,cnt);for(i=0;i

283,,,b[i]);fclose(fp);)ਭਮ⚪55(id35âᦪ¼᣸⚪)mnᦪOᦻin.dat;Hᨵ300½zᦪm2ᵨ+ᦪReadDat஺4¾ᦪHᐭᦪa;()ᑴ@+ᦪjsValue(),ᐸ/ᡠᨵ¾½zᦪâᦪḄᦪent,Ö4ᡠᨵ#ᩩḄ½zᦪÁÂHᐭᦪb;ᯠ1ᦪbḄ½zᦪᢥghᑮᜧḄ¥B᣸,ᨬ12ᵨᑏ+ᦪwriteDat஺4567ᑮout.datᦻ஺¨᝞5591âᦪᑣÃᦪᩩHᐭᦪb;Çᦪcnt=cnt+l஺9812ïâᦪᑣÃᦪ¸ᩩ×ᶍ஺EᑖGHᙠᦻprogl.c;஺;m²Ìᦪa[300],b[300],m²Ì¡ent(JᦋLM+ᦪmain஺ஹ+ᦪReadDat()ᑏ+ᦪwriteDat()ḄᑁQ஺#includeinta[300],b[300],cnt=0;intisP(intm){inti;for(i=2;ib|jj){value=b[i];b[i]=b[j];b[j]=value;J)main()(inti;readDat();jsValueQ;writeDat();printf(ncnt=%d

284u,cnt);for(i=0;i

285",i,b[i]);

286readDat()(FILE*fp;inti;fp=fopen("in.dat",ur");for(i=0;i<300;i++)fscanf(fp,H%d,n,&a[i]);fclose(fp);)writeDat()(FILE*fp;inti;fp=fopen("out.dat",Hwn);fprintf(fp,"%d

287",cnt);for(i=0;i

288';b[i]);fclose(fp);}⚪56(id87Dxðᣚ⚪)+ᦪReadDat஺,-gᦻENGIN;•ñòᦻᦻóHᐭᑮDxᦪxx;V()ᑴ+ᦪencryptChar(),ᢥ±²Ḅð>ᐵõᦪxx;ḄᡠᨵDxBð>HᐭᦪxxḄöḄzª»ᨬ12ᵨ+ᦪWriteDat஺456xx7ᑮᦻPS5.DAT;஺ð>ᐵõf(p)=p*llmod256(pᦪ;÷@DxḄASCII¤f(p)1§DxḄASCII¤)᝞61f(p)¤h32ᡈf(p)öḄDxhᑏDùᑣÃDx¸¡ᔲᑣef(p)ᡠöḄDxBð>஺EᑖGHᙠᦻprogl.c;஺·ûᦪOᦻHḄüýuḄþᙳh80Dx஺(JᦋLM:+ᦪmain஺ஹᦪO+ᦪReadDat஺7ᦪO+ᦪWriteDat஺ḄᑁQ஺#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻóḄÿᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,j;for(i=0;i

289for(j=0;j='a&&xx[i*11%256<=Z)continue;elsexx[i=xx[i*11%256;}voidmain()(clrscr();if(ReadDat()){printf("ᦪᦻENGINᡭ

290\007n);return;}encryptChar();WriteDat();)intReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(',eng.in',,"r"))==NULL)return1;while(fgets(xx[i],8O,fp)!=NULL){p=strchr(xx[i],,

291,);if(p)*p=O;i++)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen("ps5.dat',»,,w");for(i=0;i

292n,xx[i]);fprintf(fp,M%s

293",xx[ij);fclose(fp);

294voidencryptChar(){inti,j,tem;for(i=0;i='a,&&tem<=,z,)continue;elsexx[i][j]=tem;})temintஹunsignedchar>unsignedint,"ᓟ$%&tem'(char)஺+⚪-ᨵ/0123⚪8ਭਮ⚪657(78id1099ᙌ⚪)'ᨵn<=>ᙶᙌ@ᢥBC┐2ᔣF1ᑮnHI1FJs<=KL1ᑮmḄNᦪ1NᦪᑮJm<=1+=9ᙌ1OFPḄQ<=RSK1ᑮmḄNᦪ1᝞+LQUVᑮᡠᨵḄ=X9ᙌY஺Z⌕\ᢥ9ᙌ]^1_10=`1a9n<=ḄB^⊤஺cὃeHᑴgᦪJosegh()hZ+i@jᵨgᦪWriteDat஺lmnpo9ᑮᦻJOSE.OUT஺'n=100,s=Lm=10o(1)&•1ᑮn<=Ḅ^Iqᐭsᦪ`p(2)tJi<=Nᦪu9ᙌ1ᑣ&p[i]wxᦪ`Ḅ᎔ᦪJi#defineN100#defineS1#defineM10intpllOOJ,n,s,m;voidWriteDat(void);voidJosegh(void){inti,j,sl,w;sl=s;for(i=l;i<=n;i++)p[i-l]=ifor(i=n;i>=2;i-)

295{sl=(sl+m-l)%i;if(sl==O)sl=i;w=p[sl-l];for(j=sl;j=0;i—){printf(n%4d",p[i]);fprintf(fp,,'%4d",p[i]);if(i%10==0){printf("

296");fprintf(fp,n

297n);))fclose(fp);+⚪Ḅh▭{Ḅὃ⚪'ᨵn<=>ᙶᙌ@ᢥBC┐2ᔣF1ᑮnHI1FJs<=KL1ᑮmḄNᦪ,NᦪᑮJm<=1+=9ᙌ1OFPḄQ<=RSK1ᑮmḄNᦪ1᝞+LQUVᑮᡠᨵḄ=X9ᙌY஺Z⌕\ᢥ9ᙌ]^1a9n<=ḄB^⊤p஺cὃeHᑴgᦪJosegh஺hZ+i@jᵨgᦪWriteDat஺lHIᢥ᯿9ᙌḄB^o9ᑮOUT.DATᦻ஺J1<9ᙌḄHIqᙠp[0]1J2<9ᙌḄHIqᙠp[l],VJn<9ᙌḄHIqᙠp[n-l]஺'n=100,s=1,m=10LH஺ᑖ^qᙠPROG1.C஺

298cᦋgᦪmain()o9ᦪgᦪWriteDat()Ḅᑁ஺#include#defineN100#defineS1#defineM10intp[100],n,s,m;voidWriteDat(void);voidJosegh(void){inti,j,sl,w,q[100];for(i=0;i=2;i—){sl=(sl+m-l)%i;if(sl==O)sl=i;w=p[sl-l];for(j=sl;j=0;i++,j--)/*ᦋfor(i=0,j=n-l;i

299if(j%10=0){printf(n

300n);fprintf(fp,"

301M);))fclose(fp);)ਭਮ⚪658(78id31⌱ἠ±⚪)Zᨵ<10<=100Ḅ⌱ἠᦪᦻIN.DAT,ᐸᦪqḄ³¥_ᩩµ¶Ḅ·¸ᙳ10z1Jz⊤ºJ<=Ḅ⌱»¼1J½z⊤ºJ½<=Ḅ⌱»¼1+¾¿ᑁᙳÀÁ஺1,1⊤º+=Â⌱10⊤º+=ÃÂ⌱1t•Ä⌱ἠ=ᦪÅxÆx5<=CÂÇ7ᦔḄ⌱ἠ஺agᦪReadDat஺Ḅi¥l⌱ἠᦪÉᐭᑮÀÁÊᦪ`xx஺cHᑴgᦪCountRsOᩭËÌ_<=Ḅ⌱ἠᦪ@lÍἠᦪ]qᐭyy[O]ᑮyy[9]஺lmnyyo9ᑮᦻOUT.DAT஺ᑖ^qᙠᦻprogl.c஺cᦋgᦪmain஺ஹÉᦪgᦪReadDat()o9ᦪgᦪwriteDat஺Ḅᑁ஺#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][j]==T)count++;if(count<=5)continue;for(j=0;j<10;j++)if(xx[i==T)yy[j]++;voidmain()(inti;for(i=0;i

302\007)return;

303CountRs();WriteDat();)intReadDat(void)(FILE*fp;inti;if((fp=fopen("IN.DAT",T'))==NULL)return1;for(i=0;i<100;i++){if(fgets(xx[i],l2,fp)==NULL)return1;xx[i][10]=W;)fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen("OUT.DAT","w");for(i=0;i<10;i++){fprintf(fp,"%d

304",yy[i]);printf("JÎd<=Ḅ⌱ἠᦪ=%d

305",i+l,yy[i]);}fclose(fp);ਭਮ⚪65978id141᦮ᦪᔜzᡭᦣ`ᔠÓÔ⚪⚪ÕÖᦪᦻIN.DATqᨵ200<×zᦪ1@ÕjᵨÉgᦪreadDatlØᦪqᐭᦪ`a1cὃeHᑴgᦪjsVal,ᐸi¥lᓟzᦪÀᓝzᦪÀRS`ᡂ

306Ḅ<ᦪcntoᨬumain()gᦪjᵨᑏgᦪwriteDat஺lmnentÜᦪ`bÁᔠᩩḄ×zᦪo9ᑮOUT.DATᦻ஺ᑖ^qᙠᦻprogl.c஺^Õᦪ`:a[200],b[200],ÕentcᦋᦪᦻIN.DATḄìíᦪஹgᦪmain()ஹÉgᦪreadDat஺ᑏgᦪwriteDat()Ḅᑁ஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsVal(){inti,thou,hun,ten,data,j;intab,cd;for(i=0;i=10&&cd>=10){b[cnt]=a[i];cnt++;))for(i=0;i

307”,ent);for(i=0;i

308writeDatO(FILE*fp;inti;fp=fopenC'out.dat",nwu);fprintf(fp,n%d

309",ent);for(i=0;i

310n,b[i]);fclose(fp);)⚪660(78id84᦮ᦪÓÔ᣸^⚪)ᙠᦻin.datᨵ200`ᦪ1_`ᨵ3<ᦪ1_<ᦪᙳ¥ïzᦪ஺gᦪReadDat஺Éð200`ᦪqᑮm᪀ᦪ`aa1cHᑴgᦪjsSort(),ᐸgᦪḄi¥⌕\ᙠ200`ᦪòH1ᩩ_`ḄJ½<ᦪᜧxJ<ᦪóJï<ᦪḄô1ᐸæçᩩḄ`ᦪõgᦪjsSort()Ḅö÷ø1äClæçᩩḄᦪqᐭm᪀ᦪ`bb1OùbbḄᦪᢥ᯿_`ᦪḄJ½<ᦪóJï<ôḄᜧÅLú^᣸ᑡ(J½<ᦪóJï<ᦪḄᙳüÆ)1᣸^uḄmnýRSqᐭm᪀ᦪ`bb1ᨬujᵨgᦪWriteDatOlmnbbo9ᑮᦻout.dat஺ᑖ^qᙠᦻprogl.c஺cᦋgᦪmain஺ஹÉᦪgᦪReadDat஺o9ᦪgᦪWriteDatOḄᑁ஺#include#include#includetypedefstruct{intxl,x2,x3;}data;dataaa[200],bb[200];intjsSortQ{inti,j,cnt=0;datach;for(i=0;i<200;i++)if(aa[i].x2>aa[i].xl+aa[i].x3)bb[cnt++]=aa[i];for(i=0;i

311intcount;readDat();count=jsSort()/*ö÷æçᩩḄ<ᦪ*/writeDat(count);)readDat()(FILE*in;inti;in=fopen(1,in.dat',,,,r");for(i=0;i<200;i++)fscanf(in/%d%d%d'\&aa[i].xl,&aa[i].x2,&aa[i].x3);fclose(in);)writeDat(intcount)(FILE*out;inti;out=fopen(',out.dat","w");clrscr();for(i=0;i

312",bb[i].xl,bb[i].x2bb[i].x3,bb[i].x2+bb[i].x3);,fprintf(out,M%d%d%d

313H,bb[i].xl,bb[i].x2,bb[i].x3);)fclose(out);)⚪661(78id19m᪀þÓÔ⚪)ÕÖᙠᦻIN.DATqᨵ100<ÿ├├ᵫṹdm(4)me(10)ᓫdj(᦮)ᦪsi(᦮)je(᦮)ᑖᡂ஺ᐸ#$=ᓫ*ᦪ'()*஺+ᦪReadDat(),-./100├01ᐭ3᪀ᦪsell#஺56ᑴ+ᦪSortDat஺ᐸ89⌕;$ᢥ=>ᑮᜧAB᣸ᑡEFGᑣᢥṹ=ᜧᑮ>AB᣸ᑡᨬJ᣸ᑡ3KL1ᐭ3᪀ᦪsell#ᨬMNᵨ+ᦪWriteDat஺P3KQ*ᑮᦻSOUT2.DAT#஺ᑖTUV1ᙠᦻSprogl.c#஺5XᦋZ[+ᦪmain஺ஹ-ᦪ]+ᦪReadDat()^Q*ᦪ]+ᦪWriteDat஺Ḅᑁa஺#include

314#include#include#include#include#defineMAX100typedefstruct{chardm[5];/*ṹ*/char01411];/**/intdj;/*ᓫ*/intsi;/*ᦪ*/longje;/**/}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){intijdPROxy;for(i=0;i<99;i++)for(j=i+ldj<100;j++)if(sell[il.je>sell[j].jellsell[i].je==sell[j].je&&strcmp(sell[i].dm,sell[j].dm)

315memcpy(sell[i].mc,str+4,10);memcpy(ch,str+14,4)dch[4]=0;sell[i].dj=atoi(ch);memcpy(ch,str+18,5);ch[5]=0;sellfi].sl=atoi(ch);sell[i].je=(long)sell[i].dj*sell[i].sl;)fclose(fp);voidWriteDat(void)(FILE*fp;inti;fp=fopen("OUT2.DATH,uw");for(i=0;i<100;i++){printf(n%s%s%4d%5d%5d

316",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fp,H%s%s%4d%5d%5d

317"sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)⚪f62(ghid9iᣚ⚪)ghid9⚪ᩩSlᨵnGopᙠM☢r*+ᦪReadDat()st=ᦻSENG.IN#-.•vwᦻᦻx1ᐭᑮyᦪxx#d56ᑴ+ᦪencryptChar(),ᢥrzḄiᐵ|}ᦪxx#ḄᡠᨵABiL1ᐭᦪxxḄ}ḄᨬMNᵨ+ᦪWriteDat஺P3KxxQ*ᑮᦻSPS2.DAT#஺iᐵ|$f(p)=p*13mod256(p,ᦪ#ḄASCHf(p),'(MḄASCII)᝞K'(Mf(p)>32ᡈᐸASCII,Ꮤᦪᑣnᔲᑣf(p)ᡠ}ḄABi஺ᑖTUV1ᙠᦻSprogl.c#஺ᦪ]ᦻS1Ḅ,$BḄᙳ>80஺5XᦋZ[+ᦪmain஺ஹ-ᦪ]+ᦪReadDat()^Q*ᦪ]+ᦪWriteDat஺Ḅᑁa஺#include#include#include#includeunsignedcharxx|50][80];intmaxline=0;/*ᦻxḄBᦪ*/intReadDat(void);voidWriteDat(void);

318voidencryptChar(){inti,j;for(i=0;i

319\007");return;)encryptChar();WriteDat();)intReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(Heng.in,,,',r,,))==NULL)return1;while(fgets(xx[i],8O,fp)!=NULL){p=strchr(xx[i],,

320,);if(p)*p=O;i++d)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(',ps2.datu,"w");for(i=0;i

321printf(',%s

322H,xx[i]);fprintf(fp,"%s

323n,xx[i]);fclose(fp);)voidencryptChar()/*᝞K'(Mf(p)>32ᡈASCII,Ꮤᦪ*/{inti,jdfor(i=0;i#include#defineN81voidreadwriteDAT();voidchg(char*s){inti;charch=*s;for(i=0;i

324puts(a);readwriteDAT();)voidreadwriteDATQ(inti;chara[N];FILE*rf,*wf;rf=fopenCbc2.inu,V);wf=fopen(,,bc2.out,

325wn);for(i=0;i<50;i++){fscanf(rf,"%sn,a);chg(a);fprintf(wf,u%s

326",a);)fclose(rf);fclose(wf);)ਭ⚪f64(ghid22¯ᦪ⚪)°ᑡUVḄ89,$±*ᡠᨵ100²ᑁ(³100)´µI,1+4,1+10¶,¯ᦪḄ᦮ᦪI(1+10·ᙠ100²ᑁ)Ḅᦪent²¸/¹Iº^sumo56ᑏ+ᦪcountValue஺stUV⌕;Ḅ89ᨬMNᵨ+ᦪwriteDat஺P3Kent^sumQ*ᑮᦻSout.dat#஺ᑖTUV1ᙠᦻSprogl.c#஺5XᦋZ[+ᦪmain஺^Q*ᦪ]+ᦪwriteDat()Ḅᑁa஺#includeintent,sum;intisPrime(intnumber)(inti,tag=l;for(i=2;tag&&i<=number/2;i++)if(number%i==0)tag=0;returntag;)voidcountValue(){inti;for(i=2;i<=90;i++)if(isPrime(i)&&isPrime(i+4)&&isPrime(i+10)){cnt++;sum+=i;}

327voidmain()(cnt=sum=0;countValue();printf("´µᩩSḄ᦮ᦪḄᦪ=%d

328”,cnt);printf("´µᩩSḄ᦮ᦪḄ^=%d

329",sum);writeDat();)writeDat()(FILE*fp;fp=fopen("out.dat',,',wn);fprintf(fp,',%d

330%d

331',,cnt,sum);fclose(fp);)»B3K¬$´µᩩSḄ᦮ᦪḄᦪ=7´µᩩSḄ᦮ᦪḄ^=201ਭਮ⚪f65(ghid45᦮ᦪ¼'»(⚪)½¾ᙠᦻSIN.DAT#1ᨵE¿(ᦪீ200)ÁᦪḄÂ᦮ᦪ+ᦪReadDat஺-./E¿Â᦮ᦪ01ᐭᦪxx#஺56ᑴ+ᦪCalValue஺ᐸ89⌕;$1ஹ;*/ᦻS#ᐳᨵÄÂ᦮ᦪtotNumd2ஹ;/¹ᦪ#Ḅᔜᦪº^,᜻ᦪḄᦪḄᦪtotCnt,²¸´µᩩSḄ/¹ᦪḄ(ÇÈᙳtotPjz,ᨬMNᵨ+ᦪwriteDat஺Pᡠ;Ḅ3KQ*ᑮᦻSOUT.DAT#஺ᑖTUV1ᙠᦻSprogl.c#஺5XᦋZ[+ᦪmain஺ஹ-+ᦪReadDal஺^ᑏ+ᦪwriteDal஺Ḅᑁa஺#include#include#defineMAXNUM200intxx[MAXNUM];inttotNum=0;/*ᦻSIN.DAT#ᐳᨵÄÂ᦮ᦪ*/inttotCnt=0;/*ᔠᩩSḄÂ᦮ᦪḄᦪ*/doubletotPjz=0.0;/*Èᙳ*/intReadDat(void);voidwriteDat(void);voidCalValue(void){inti,qw,bw,sw,gw;

332for(i=0;i0){totNum++;qw=xx[i]/l000;bw=xx[i]/l00%10;sw=xx[i]%100/10;gw=xx[i]%10;if((qw+bw+sw+gw)%2){totCnt++;totPjz+=xx[i];})if(totCnt==0)totPjz=0;elsetotPjz/=totCnt;)voidmain()(inti;clrscr();for(i=0;i

333")dreturn;)CalValueO;printf("ᦻSIN.DAT#ᐳᨵÂ᦮ᦪ=%d

334”,totNum);printf("ᔠᩩSḄÂ᦮ᦪḄᦪ=%d

335”,totCnt);printf("Èᙳ=%.2f

336”,totPjz);writeDat();)intReadDat(void)(FILE*fp;inti=0;if((fp=fopen("IN.DAT",Mrn))==NULL)return1;while(!feof(fp)){fscanf(fp,H%d,M,&xx[i++]);)fclose(fp);return0;)voidwriteDat(void)FILE*fp;

337fp=fopen("OUT.DAT“Jw")dfprintf(fp,',%d

338%d

339%6.2f

340,',totNum»totCnt,totPjz);fclose(fp);)ਭਮ⚪f66(ghid47¯ᦪ⚪)°ᑡUVprogl.cḄ89,$'(500-800ËÌᑁ¯ᦪḄᦪent,0ᢥᡠ;¯ᦪḄ=ᜧᑮ>ḄÍVÎ'(ᐸÌ◞ÐஹѺ^ᓽ§1¯ᦪ-§2¯ᦪ+§3¯ᦪ-§4¯ᦪ+§5¯ᦪ…Ḅsum஺Ö6ᑏ+ᦪcountValue()stUVḄ⌕;ᨬMNᵨ+ᦪwriteDat()P3Kent^sum,Q*ᑮᦻSOUT11.DAT#஺ᑖTUV½r*஺5XᦋZ[+ᦪmain஺^Q*ᦪ]+ᦪwriteDat஺Ḅᑁa஺#includeintent,sum;voidcountValue(){inti,j,k=l;for(i=800;i>500;i-){for(j=2;j

341”,sum);writeDat();)writeDat()(FILE*fp;fp=fopen(',OUTn.DAT",',wn);fprintf(fp,"%d

342%d

343,,,cnt»sum);fclose(fp);

344⚪f67(ghid49᦮ᦪᔜᦪ»(⚪)°ᑡUVḄ89,$⌱*5000²°ᔠᩩSḄÝᯠᦪ஺ᩩS,$ᓟᦪàáᦪº^ᓝᦪàᦪº^ãᓟᦪàáᦪº^ᦪàᓟᦪºäḄ10å஺'(0Q*/¹ÁÝᯠᦪḄᦪent²¸/¹ᦪḄ^sum஺56ᑏ+ᦪcountValue஺stUVḄ⌕;ᨬMNᵨ+ᦪwriteDat஺P3Kent^sum,Q*ᑮᦻSOUT13.DAT#஺ᑖTUV1ᙠᦻSprogl.c#஺5XᦋZ[+ᦪmain()^Q*ᦪ]+ᦪwriteDat()Ḅᑁa஺#includeintent,sum;voidcountValue(){inti,thou,hun,ten,data;for(i=1000;i<5000;i++){lhou=i/l000;hun=i%1000/100;ten=i%100/10;data=i%10;if(thou+hun==ten+data&&lhou4-hun==(data-thou):{:10){cnt++;sum+=i;}voidmain()(cnt=sum=0;countValue();printf("´µᩩSḄÝᯠᦪḄᦪ=%Д,æ)dprintf("´µᩩSḄÝᯠᦪḄᦪº^ç%M1è§1101);writeDat();writeDat()(FILE*fp;fp=fopen(MOUT13.DAT',,',w");fprintf(fp,n%d

345%d

346'\cnt,sum);fclose(fp);)ਭਮ⚪f68(ghid142᦮ᦪᔜᦪ¼'»(⚪)½¾ᦪ]ᦻSIN.DAT#1ᨵ200Áᦪ0½Nᵨ-+ᦪreadDat஺P/¹ᦪ1ᐭᦪa#5ὃ©6ᑴ+ᦪjsVal(),ᐸ89,$᝞KÁᦪᔜḄᦪᙳ,᜻ᦪᑣ¼'*´µᩩSḄᦪent0P/¹Áᦪᢥ=ᜧᑮ>ḄÍV1ᐭᦪb#஺ᨬMmain()+ᦪNᵨᑏ+ᦪwriteDat()P3Kent²¸ᦪb#ᔠᩩSḄÁᦪQ*ᑮOUT.DATᦻS#஺

347®$ᑖTUV1ᙠᦻSprogl.c#஺UV#½zêᦪ$a[200],b[200],½zê$ent5XᦋZᦪ]ᦻSIN.DAT#Ḅëìᦪ]ஹ[+ᦪmain()ஹ-+ᦪreadDat஺^ᑏ+ᦪwriteDat()Ḅᑁa஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsVal(){inti,j,thou,hun,ten,data;for(i=0;i<200;i++){thou=a[i]/l000;hun=a[i]%1000/100;ten=a[i]%100/10;data=a[i]%10;if(thou&&thou%2&&hun%2&&ten%2&&data%2)b[cnt++]=a[i];)for(i=0;i

348”,ent);for(i=0;i

349");writeDat();writeDat()(FILE*fp;inti;

350fp=fopen(Mout.datM,"w1');fprintf(fp,n%d

351n,ent);for(i=0;i

352M,b[i]);fclose(fp);ਮ⚪f69(ghid145᦮ᦪ¼'»(⚪)½¾ᦪ]ᦻSIN.DAT#1ᨵ200Áᦪ0½Nᵨ-+ᦪreadDat஺P/¹ᦪ1ᐭᦪa#5ὃ©6ᑴ+ᦪjsVal(),ᐸ89,$P•ÁᦪḄᓟᦪḄÑíáᦪḄÎÑíîᦪḄᨬMÑíᦪḄ,᝞K)*ḄᜧïãÁᦪ,᜻ᦪᑣ¼'*´µᩩSḄᦪent0P/¹Áᦪᢥ=>ᑮᜧḄÍV1ᐭᦪb#ᨬMNᵨᑏ+ᦪwriteDat஺P3Kent²¸ᦪb#ᔠᩩSḄÁᦪQ*ᑮOUT.DATᦻS#஺®$ᑖTUV1ᙠᦻSprogl.c#஺UV#½zêᦪ:a[200J,b[200],½zê$ent5XᦋZᦪ]ᦻSIN.DAT#Ḅëìᦪ]ஹ[+ᦪmain஺ஹ-+ᦪreadDat஺^ᑏ+ᦪwriteDat()Ḅᑁa஺#include#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsValO{inti,j,thou,hun,ten,data;for(i=0;i<200;i++){thou=a[i]/1000;hun=a[i]%1000/100;ten=a[iJ%100/10;data=a[i]%10;if(thou-hun-ten-data>=0&&a[i]%2)b[cnt++]=a[i];)for(i=0;ib[j]){thou=b[i];b[i]=bfj];bfj]=thou;}voidreadDat()inti;FILE*fp;fp=fopen(nin.datn,nrM);for(i=0;i

353inti;readDat();jsVal();printf("´µᩩSḄᦪ=%d

354”,ent);for(i=0;i

355n);writeDat();)writeDat()(FILE*fp;inti;fp=fopen(',out.dat,',"w");fprintf(fp,"%d

356",ent);for(i=0;i

357",b[i]);fclose(fp);Iਭ⚪f70(ghid41᦮ᦪ¼'»(⚪)½¾ᙠᦻSIN.DAT#1ᨵE¿(ᦪ<200)ÁᦪḄÂ᦮ᦪ+ᦪReadDat஺-./E¿Â᦮ᦪ01ᐭᦪxx#஺56ᑴ+ᦪCalValue஺ᐸ89⌕;$1ஹ;*/ᦻS#ᐳᨵÄÂ᦮ᦪtotNumd2ஹ;/¹ᦪñ¥1M©Ḅᦪ,᜻ᦪḄᦪḄᦪtotCnt,²¸´µᩩSḄ/¹ᦪ(ñ¥òḄ)Ḅ(ÇÈᙳtotPjz,ᨬMNᵨ+ᦪwriteDat஺Pᡠ;Ḅ3KQ*ᑮᦻSOUT.DAT#஺ᑖTUV1ᙠᦻSprogl.c#஺5XᦋZ[+ᦪmain஺ஹ-+ᦪReadDat஺^ᑏ+ᦪwriteDat஺Ḅᑁa஺#include#include#defineMAXNUM200intxx[MAXNUMJ;inttotNumH);/*ᦻSIN.DAT#ᐳᨵÄÂ᦮ᦪ*/inttolCnt=0;/*ᔠᩩSḄÂ᦮ᦪḄᦪ*/doubletotPjz=0.0;/*Èᙳ*/intReadDat(void);voidwriteDat(void);voidCalValue(void){inti,data;for(i=0;i0){totNum++;

358data=xx[i]»l;if(data%2){totCnt++;totPjz+=xx[i];})if(totCnt==0)totPjz=0;elsetotPjz/=totCnt;)voidmain()(inti;clrscr();for(i=0;i

359")dreturn;)CalValueO;printf("ᦻSIN.DAT#ᐳᨵÂ᦮ᦪç%d

360”,totNum);printf("ᔠᩩSḄÂ᦮ᦪḄᦪ=%d

361\totCnt);printf("Èᙳ=%.2f

362”,totPjz);writeDat();)intReadDat(void)(FILE*fp;inti=0;if((fp=fopen(',IN.DATnd,ru))==NULL)return1;while(!feof(fp)){fscanf(fp,"%d,u,&xx[i++J);}fclose(fp);retum0;)voidwriteDat(void)(FILE*fp;fp=fopen("OUT.DAT,,,,,wH);fprintf(fp,,,%d

363%d

364%6.2f

365H,totNum,totCnt,totPjz);fclose(fp);

366ਮ⚪f71(ghid6y¦ñ᣸V⚪)+ᦪReadDat()st=ᦻSin.dat#-.20Bᦪ]1ᑮyᦪxx#(Byᙳ>80)஺56ᑴ+ᦪjsSort(),ᐸ+ᦪḄ89,$²B¬ᓫ}yᢥrzḄᩩSAB᣸V᣸VMḄ3KLᢥBó1ᐭyᦪxx#ᨬMNᵨ+ᦪWriteDat()P3KxxQ*ᑮᦻSout.dat#஺ᩩS$=y#Ìᑖ¬ç¦ôᑖᢥḄASCIIõV᣸VñôᑖᢥḄASCIIᓣV᣸V஺᝞Ky¬᜻ᦪᑣᨬ#ÌḄn÷Ð᣸VLᙠ஺«᝞$012345678Tyabcdhgfe123498765ᑣᜐᳮMydcbaefgh432195678ᑖTUV1ᙠᦻSprogl.c#஺5XᦋZ[+ᦪmain஺ஹ-ᦪ]+ᦪReadDat஺^Q*ᦪ]+ᦪWriteDat஺Ḅᑁa஺#include#include#includecharxx[20][80];voidjsSort(){inti,j,k,strl,half;charch;for(i=0;i<20;i++){strl=strlen(xx[i]);half=strl/2;for(j=0;jxx[i][k]){ch=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=ch;}voidmain()(readDat();jsSort();writeDat();

367readDat()FILE*in;inti=O;char*p;in=fopen("in.dat","rn);while(i<20&&fgets(xx[i],80,in)!=NULL){p=strchr(xx[i],,

368');if(p)*p=O;i++d)fclose(in);)writeDat()(FILE*out;inti;clrscr();out=fopen(',out.dat,,,"wH);for(i=0;i<20;i++){printf("ús

369”,xx[i]);fprintf(out,n%s

370",xx[i]);)fclose(out);}ਭਮ⚪f72ûghid136᦮ᦪᔜᡭᦣᔠ»(⚪ý½¾ᦪ]ᦻSIN.DAT#1ᨵ200Áᦪ0½Nᵨ-+ᦪreadDal஺P/¹ᦪ1ᐭᦪa#5ὃ©6ᑴ+ᦪjsVal,ᐸ89,$Pᦪ^ᓟᦪóᡂḄᓝᦪûîᦪḄᓝᦪ,ÁᦪḄᦪᓝᦪḄᦪ,ÁᦪḄᓟᦪý²¸Páᦪ^ᓝᦪᡂþḄᓝᦪûᓝᦪḄᓝᦪ,ÁᦪḄáᦪᓝᦪḄᦪ,ÁᦪḄᓝᦪý᝞KᡂḄÿᦪᙳᏔᦪᓝᦪᨵᦪ9᦮◀ᦪḄᓝᦪᙳᑣ!ᩩ#Ḅ$ᦪᢥ&ᜧᑮ)Ḅ*+,ᐭᦪ.b⌕0123ᩩ#Ḅ$ᦪḄᦪent஺ᨬ6main஺7ᦪ8ᵨᑏ7ᦪwriteDat;<=>ent?@ᦪ.bAᔠᩩ#Ḅ$ᦪCDᑮOUT.DATᦻ#஺FGHIᑖKL+,ᙠᦻ#progLc஺L+NOPᦪ.Ha[200],b[200],NOPQRHent

371TUᦋWᦪXᦻ#IN.DATḄYZᦪXஹ\7ᦪmain()ஹ]7ᦪreadDat஺^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsVal(){inti,j,thou,hun,ten,data,ab,cd;for(i=0;i<200;i++){thou=a[i]/l000;hun=a[i]/l00%10;ten=a[i]%100/l0;data=a[i]%10;ab=10*data+thou;cd=10*hun+ten;if((ab%9==0llcd%9==0)&&ab%2==0&&cd%2=0&&hun!=0&&data!=0){b[cnt]=a[i];cnt++;)}for(i=0;i

372”,ent);for(i=0;i

373”);writeDat();writeDat()(FILE*fp;inti;

374fp=fopen(nout.datH,Hwu);fprintf(fp,M%d

375u,ent);for(i=0;i

376M,b[i]);fclose(fp);)ਭ⚪e73(fgid26Ahᣚ⚪)7ᦪReadDat()kl&ᦻ#IN.DAT]mnoᦻᦻp,ᐭᑮAqᦪ.xxTrᑴ7ᦪConveCharD(),ᐸ7ᦪḄuH?vᓫ<AqḄᡠᨵ)ᑏyᦋᑏᡂ{yḄ2y᝞>ya,ᑣᦋᑏᡂyZoᜧᑏy}ᜧᑏy)ᑏy})ᑏyᐸ~AQ஺ᨬ6xxCDᑮᦻ#OUT4.DAT஺HᦻHAdb.Bcdzaabck.LLhj=>HAca.Bbcyzzabj.LLgiᦪXᦻ#,ḄHvḄᙳ)80A᪗A^஺IᑖKL+,ᙠᦻ#progl.c஺TUᦋW\7ᦪmain஺ஹ]ᦪX7ᦪReadDat஺^CDᦪX7ᦪwriteDat()Ḅᑁ`஺#include#include#includecharxx[50][80];intmaxline=0;/*ᦻpḄvᦪ*/intReadDat(void);voidWriteDat(void);voidConvertCharD(void){inti,j;for(i=0;i='b,&&xx[i]fj]<=,z,)xx[i][jl-=l;voidmain()(clrscr();if(ReadDat()){printf("ᦪXᦻ#IN.DATᡭ!

377\007");return;

378ConvertCharD();WriteDat();)intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen(nIN.DATn'ru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]”)if(p)*p=O;i++)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen("OUT4.DAT"'w");for(i=0;i

379",xx[i]);fprintf(fp,H%s

380H,xx[iJ);)fclose(fp);)⚪e74(fgid70AASCIIhᣚ⚪)7ᦪReadDal()kl&ᦻ#IN.DAT]mnoᦻᦻp,ᐭᑮAqᦪ.xxTrᑴ7ᦪStrCharJLO,ᐸ7ᦪḄuH?vᓫ<AqḄᡠᨵAḄASCII4,᝞>6ᐸAḄASCH)32ᡈᜧ100,ᑣAᢝQᔲᑣ¡<6ḄAASCII¢£2AASCII¤ᑮḄA},ᐭAq¥¦Ḅ§2஺ᨬ6xxCDᑮᦻ#OUT7.DAT஺ᦪXᦻ#,ḄHvḄᙳ)80A᪗A^஺

381IᑖKL+,ᙠᦻ#progl.c஺TUᦋW\7ᦪmain஺ஹ]ᦪX7ᦪReadDat஺^CDᦪX7ᦪwriteDat஺Ḅᑁ`஺#include#include#includecharxx[50][80];intmaxline=0;/*ᦻpḄvᦪ*/intReadDat(void);voidWriteDat(void);voidStrCharJL(void){inti,j;charc;for(i=0;i100))xx[i][j]+=c;)}voidmain()(clrscr();if(ReadDat()){printf("ᦪXᦻ#IN.DATᡭ¨

382\007M);return;)StrCharJL();WriteDat();)intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen(,,IN.DATn,r,,))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xxli]An,);if(p)*p=O;i++

383maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen("OUT7.DAT"/w");for(i=0;i

384”,xx[i]);fprintf(fp,',%s

385,',xx[i]);)fclose(fp);}ਭਮ⚪e75(fgID10᦮ᦪᔜᦪ¬1@᣸+⚪)ᙠᦻ#in.datᨵ200.ᦪX.ᨵ3ᦪᦪᙳ®ᦪ஺7ᦪReadDat஺]m¯200.ᦪX,ᑮ=᪀ᦪ.aaTrᑴ7ᦪjsSort(),ᐸ7ᦪḄuH⌕±ᙠ200.ᦪX²Dᩩ#.Ḅ³ᦪᜧ³´ᦪ£³®ᦪḄ^ᐸᩩ#Ḅ.ᦪµ7ᦪjsSort()Ḅ¶·<ᩩ#ḄᦪX,ᐭ=᪀ᦪ.bb¢¥bbḄᦪXᢥ᯿.ᦪXḄ³ᦪ£³®¹^Ḅᜧ)ºvᓣ+᣸ᑡ(³ᦪ£³®ᦪḄ^ᙳ½)᣸+6Ḅ=>},ᐭ=᪀ᦪ.bbᨬ68ᵨ7ᦪwriteDat()<=>bbCDᑮᦻ#out.dat஺IᑖKL+,ᙠᦻ#progl.c஺TUᦋW\:7ᦪmain஺ஹ]ᦪX7ᦪReadDat()^CDᦪX7ᦪWriteDat஺Ḅᑁ`஺#include#include#includetypedefstruct(intxl,x2,x3;}data;dataaa[200],bb[200];intjsSort(){inti,j,cnt=O;dataxy;for(i=0;i<200;i++)

386if(aa[i].xl>(aa[i].x2+aa[i].x3))bb[cnt++]=aa[i];for(i=0;ibb[j].xl+bb[j].x3){xy=bb[i];bb[i]=bb[j];bb[j]=xy;}returnent;)voidmain()(intcount;readDat();count=jsSort();/*¶·ᩩ#Ḅᦪ*/writeDat(count);)readDat()(FILE*in;inti;in=fopen("in.dat","rn);for(i=0;i<200;i++)fscanf(in,"%d%d%d",&aa[i].xl,&aa[i].x2,&aa[i].x3);fclose(in);)writeDat(intcount)(FILE*out;inti;clrscr();out=fopen("out.dat",Hwn);for(i=0;ih^+^H>b^=%d

387',,bb[i].xl,bb[i].x2,bb[i].x3,bb[i].xl+bb[i].x3);fprintf(out,"%d%d%d

388'\bb[i].xl,bb[i].x2,bb[i].x3);)fclose(out);)ਭਮ⚪e76(fgid137᦮ᦪᔜᡭᦣ.ᔠ¬1⚪)NÀᦪXᦻ#IN.DAT,ᨵ200$ᦪN8ᵨ]7ᦪreadDat஺<¯Áᦪ,ᐭᦪ.aTὃÃrᑴ7ᦪjsVal(),ᐸuH<ᦪ^ᓟᦪ.ᡂḄᓝᦪ(ᦪḄᦪ$ᦪḄᦪᦪḄᦪ$ᦪḄᓟᦪ

389)?@<Åᦪ^ᓝᦪ.ᡂÆḄᓝᦪ(ᓝᦪḄᓝᦪ$ᦪḄÅᦪᓝᦪḄᦪ$ᦪḄᓝᦪ)᝞>.ᡂḄᓝᦪÇÈ᜻ᦪÆᏔᦪᓝᦪᨵᦪ17᦮◀ᦪḄᓝᦪᙳᑣ!ᩩ#Ḅ$ᦪᢥ&ᜧᑮ)Ḅ*+,ᐭᦪ.b⌕0123ᩩ#Ḅ$ᦪḄᦪcntoᨬ6main()7ᦪ8ᵨᑏ7ᦪwriteDat஺<=>ent?@ᦪ.bAᔠᩩ#Ḅ$ᦪCDᑮOUT.DATᦻ#஺FGHIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.:a[200],b[200],NOPQRHentTUᦋWᦪXᦻ#IN.DATḄYZᦪX•ஹ\7ᦪmain஺ஹ]7ᦪreadDat஺^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsValO{inti,j,thou,hun,ten,data,ab,cd;for(i=0;i=10&&cd>=10))b[cnt++]=a[i];)for(i=0;i

390”,ent);

391for(i=0;i

392n);writeDat();)writeDat()(FILE*fp;inti;fp=fopenCouLdat","wu);fprintf(fp,"%d

393",ent);for(i=0;i

394",b[i]);fclose(fp);}⚪e77(fgid148᦮ᦪᔜ¬1⚪)NÀᦪXᦻ#IN.DAT,ᨵ200$ᦪN8ᵨ]7ᦪreadDat஺<¯Áᦪ,ᐭᦪ.aTὃÃrᑴ•7ᦪjsVal(),ᐸuH<$ᦪḄᓟᦪ2Ḅ£2ᓝᦪ2ḄាÌÅᦪ2Ḅ£2ᦪ2Ḅ$ᦪᏔᦪᑣÍ0D!ᩩ#Ḅᦪent<¯Á$ᦪᢥ&)ᑮᜧḄ*+,ᐭᦪ.bᨬ68ᵨᑏ7ᦪwriteDat()<=>ent?@ᦪ.bAᔠᩩ#Ḅ$ᦪCDᑮOUT.DATᦻ#஺FGHIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.:a[200],b[200],NOPQRHentTUᦋWᦪXᦻ#IN.DATḄYZᦪXஹ\7ᦪmain()ஹ]7ᦪreadDat()^ᑏ7ᦪwriteDat()Ḅᑁ`஺#include#defineMAX200inta[MAX],b[MAXJ,ent=0;voidjsVal(){inti,j,thou,hun,ten,data,ab,cd;for(i=0;ib[j]){thou=b[i];b[i]=b[j];b[j]=thou;})voidreadDat()inti;

395FILE*fp;fp=fopen(',in.datM,nrn);for(i=0;i

396”,ent);for(i=0;i

397");writeDat();writeDatO(FILE*fp;inti;fp=fopenC'out.dat",nwu);fprintf(fp,"%d

398",ent);for(i=0;i

399n,b[ij);fclose(fp);)ਮ⚪e78(fgid149᦮ᦪᔜÍ0᣸+⚪)NÀᦪXᦻ#IN.DAT,ᨵ200$ᦪN8ᵨ]7ᦪreadDat஺<¯Áᦪ,ᐭᦪ.aTὃÃrᑴ7ᦪjsVal(),ᐸuHÎ$ᦪḄᓟᦪ2ḄᜧÅᦪ2ḄÅᦪ2Ḅᜧᓝᦪ2Ḅ?@ᓝᦪ2Ḅᜧᦪ2Ḅ$ᦪ᜻ᦪᑣÍ0D!ᩩ#Ḅᦪcm<¯Á$ᦪᢥ&)ᑮᜧḄ*+,ᐭᦪ.bᨬ68ᵨᑏ7ᦪwriteDatO<=>ent?@ᦪ.bAᔠᩩ#ḄᦪCDᑮOUT.DATᦻ#஺FGHIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.:a[200],b[200],NOPQRHentTUᦋWᦪXᦻ#IN.DATḄYZᦪXஹ\7ᦪmain஺ஹ]7ᦪreadDat஺^ᑏ7ᦪwrileDat஺Ḅᑁ`஺#include#defineMAX200inta[MAX],b[MAX],ent=0;voidjsVal(){intij,thou,hun,ten,data,ab,cd;

400for(i=0;i=hun&&hun>=ten&&ten>=data&&a[i]%2)b[cnt++]=a[i];)for(i=0;ib[j]){thou=b[i];b[i]=b[j];b[j]=thou;))voidreadDat()(inti;FILE*fp;fp=fopen(,'in.dat","r");for(i=0;i

401”,ent);for(i=0;i

402");writeDat();)writeDat()(FILE*fp;inti;fp=fopen("out.dat","w");fprintf(fp,"%d

403",ent);for(i=0;i

404”,b[ij);fclose(fp);)ਭਮ⚪e79(fgid55ᦪ¬1⚪)Trᑏ7ᦪvoidcountValue(int*a,int*n),~Ḅu:±D1ᑮ1000¹ᑁ7ᡈ11᦮◀Ï7ᡈ11᦮◀Ḅᡠᨵ᦮ᦪᙠᦪ.aÐÑn¶·¯ÁᦪḄᦪ஺IᑖKL+,ᙠᦻ#progl.c஺TUᦋW\7ᦪmain஺^CDᦪX7ᦪwrileDAT஺Ḅᑁ`஺

405#include#includevoidcountValue(int*a,int*n){inti;*n=0;for(i=l;i<=1000;i++)if(i%7==0&&i%l1lli%7&&i%ll==0)a[(*n)++]=i;)main()(intaa[1000],n,k;clrscr();countValue(aa,&n);for(k=0;k

406n);elseprintf(n%5dn,aa[k]);writeDATQ;)writeDAT()(intaal1000],n,k;FILE*fp;fp=fopen("out19.dat","w");countValue(aa,&n);for(k=0;k

407n);elsefprintf(fp,"%5d",aa[k]);fprintf(fp,n

408M);fclose(fp);)ਮ⚪e80(fgid62᦮ᦪᔜᦪ¬1⚪)NÀᦪXᦻ#in.dat,ᨵ300$ᦪN8ᵨ]7ᦪReadDat()<¯Áᦪ,ᐭᦪ.aTrᑴ7ᦪjsValue஺ᐸuH±Dᦪ2ḄᦪÒᓟᦪ2ḄᦪÒÅᦪ2ḄᦪÒᓝᦪ2ḄᦪᜧḄᦪent,¢±Dᡠᨵ!ᩩ#Ḅ$ᦪÓᙳpjzl,?@!ᩩ#Ḅ$ᦪÓᙳpjz2,ᨬ68ᵨᑏ7ᦪwrileDat஺<=>CDᑮout.datᦻ#஺᝞H1239,9-1-2-3>0,ᑣ{ᦪᩩ#01Óᙳpjzl,ᦪcnt=cnt+l஺8129,9-8-1-2<0,ᑣ{ᦪᩩ#01Óᙳpjz2஺

409IᑖKL+,ᙠᦻ#prog1.c஺L+NOPᦪ.Ha[300],NOPQRHcnt,pjzl,pjz2TUᦋW\7ᦪmain஺ஹ]7ᦪReadDat஺^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#includeinta[300],cnt=0;doublepjz1=0.0,pjz2=0.0;jsValue(){inti,j,thou,hun,ten,data,n=0;for(i=0;i<300;i++){thou=a[i]/1000;hun=a[i]/100%10;ten=a[i]%100/10;data=a[i]%10;if(data-thou-hun-ten>0){cnt++;pjzl+=a[i];}else{n++;pjz2+=a[i];})if(cnt==0)pjz1=0;elsepjzl/=cnt;if(n==0)pjz2=0;elsepjz2/=n;)main()(inti;readDat();jsValue();writeDat();printf("cnt=%d

410ᩩ#ḄÓᙳpzjl=%7.2f

411ᩩ#ḄÓᙳpzj2=%7.2f

412'\cnt,pjzI,pjz2);)readDat()(FILE*fp;inti;fp=fopen(',in.dat'',',r");for(i=0;i<300;i++)fscanf(fp,H%d,H,&a[i]);fclose(fp);}writeDat()FILE*fp;

413inti;fp=fopen(,'out.dat',,"wn);fprintf(fp,,,%d

414%7.2f

415%7.2f

416",cnt,pjzl,pjz2);fclose(fp);)ਭਮ⚪e81(fgid32᦮ᦪᔜᦪ¬1⚪)NÀᦪXᦻ#in.dat,ᨵ300$ᦪN8ᵨ]7ᦪReadDat஺<¯Áᦪ,ᐭᦪ.aTrᑴ7ᦪjsValue(),ᐸuH±Dᓟᦪ2Ḅᦪ£Åᦪᓝᦪ2Ḅᦪ£ᦪ2ḄᦪḄᦪent,¢±Dᡠᨵ!ᩩ#Ḅ$ᦪÓᙳpjzl,?@!ᩩ#Ḅ$ᦪÓᙳpjz2,ᨬ68ᵨᑏ7ᦪwriteDat஺<=>CDᑮout.datᦻ#஺᝞H7153,7+1=5+3,ᑣ{ᦪᩩ#01Óᙳpjz1,ᦪcnt=cnt+1஺8129,8+1<>2+9,ᑣ{ᦪᩩ#01Óᙳpjz2஺IᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.Ha[300],NOPQRHcnt,pjzl,pjz2஺TUᦋW\7ᦪmain஺ஹ]7ᦪReadDat()^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#includeinta[300],cnt=0;doublepjzl=0.0,pjz2=0.0;jsValue(){inti,thou,hun,ten,data,n=0;for(i=0;i<300;i++){thou=alij/l000;hun=ali]%1000/100;ten=a[i]%100/10;data=a[i]%10;if(thou+hun==ten+data){cnt++;pjz1+=a[i];}else{n++;pjz2+=a[i];}}if(cnt==0)pjz1=0;elsepjzl/=cnt;if(n==0)pjz2=0;elsepjz2/=n;)main()(inti;readDat();jsValue();writeDat();printf(ncnt=%d

417ᩩ#ḄÓᙳpzjl=%7.2f

418ᩩ#ḄÓᙳpzj2=%7.2f

419u,cnt,pjz1,pjz2);

420readDat()(FILE*fp;inti;fp=fopen("in.dat",ur");for(i=0;i<300;i++)fscanf(fp,H%d,n,&a[i]);fclose(fp);)writeDat()(FILE*fp;inti;fp=fopen("out.dat',,',wn);fprintf(fp,%d

421%72f

422%72f

423M,cnt,pjzl,pjz2);fclose(fp);I⚪e82(fgid64Ôᦪ⚪)NÀᦪXᦻ#in.dat,ᨵ300$ᦪN8ᵨ]7ᦪReadDat஺<¯Áᦪ,ᐭᦪ.aTrᑴ7ᦪjsValue(),ᐸuH±Dᡠᨵ¯Á$ᦪÔᦪḄᦪent,¢±Dᡠᨵ!ᩩ#Ḅ$ᦪÓᙳpjzl,?@!ᩩ#Ḅ$ᦪÓᙳpjz2,ᨬ68ᵨᑏ7ᦪwriteDat஺<=>cnt,pjzl,pjz2CDᑮout.datᦻ#஺᝞H5591Ôᦪᑣ{ᦪᩩ#01Óᙳpjzl,ᦪcnt=cnt+I஺9812ÕÔᦪᑣ{ᦪᩩ#01Óᙳpjz2oIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.Ha[300],NOPQRHcnt,pjzl,pjz2TUᦋW\7ᦪmain஺ஹ]7ᦪReadDat஺^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#includeinta[300],cnt=0;doublepjz1=0.0,pjz2=0.0;intisP(intm){inti;for(i=2;i

424for(i=0;i<300;i++)if(isP(a[i])){pjz1+=a[i];cnt++;}elsepjz2+=a[i];if(cnt==O)pjz1=0;elsepjzl/=cnt;if(300-cnt==0)pjz2=0;elsepjz2/=(300-cnt);)main()(inti;readDat();jsValue();writeDat();printf("cnt=%d

425ᩩ#ḄÓᙳpzjl=%7.2f

426ᩩ#ḄÓᙳpzj2=%7.2f

427u,cnt,pjz1,pjz2);}readDat()(FILE*fp;inti;fp=fopen(',in.dat',,''ru)for(i=0;i<300;i++)fscanf(fp,n%dH,&a[i]);fclose(fp);)writeDat()(FILE*fp;inti;fp=fopen(Mout.datM,°wn);fprintf(fp,',%d

428%7.2f

429%7.2f

430',,cnt,pjzl,pjz2);fclose(fp);)⚪e83(fgid34Ö׬1⚪)Trᑴ7ᦪReadDat஺kl&ᦻ#IN.DAT]m1000ᓝºᑴ᦮ᦪᑮᦪ.xxTrᑴ7ᦪCompute஺ᑖØ01Dxx᜻ᦪḄᦪodd,᜻ᦪḄÓᙳavelᏔᦪḄÓᙳave2?@ᡠᨵ᜻ᦪḄÖ×totfcḄᨬ68ᵨ7ᦪWriteDat஺<=>CDᑮOUT.DATᦻ#஺01Ö×ḄÙ᝞ÚHN2

431totfc=l/NE(xx[i]-avel)i=lÛN᜻ᦪḄᦪxxÜ᜻ᦪavel᜻ᦪḄÓᙳ஺ᦪXᦻ#,ḄHv,10ᦪᵨ⌹◞஺(ᦪᙳᜧ஺)2000)IᑖKL+,ᙠᦻ#progl.c஺TUᦋW\7ᦪmain()^CDᦪX7ᦪwriteDat()Ḅᑁ`஺#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=fopenCIN.DAT","ru))==NULL)return1;/*********rᑴ7ᦪReadDat஺ḄIᑖ************/for(i=0;i

432u);fclose(fp);return0;)voidCompute(void){inti,yy[MAX];for(i=0;i

433if(even==O)ave2=0;elseave2/=even;for(i=0;i

434")return;)Compute();printf("ODD=%d

435AVEl=%f

436AVE2=%f

437TOTFC=%f

438",odd,avehave2,totfc);WriteDat();voidWriteDat(void)(FILE*fp;inti;fp=fopen(',OUT.DAT',,',wM);fprintf(fp,"%d

439%f

440%f

441%f

442',,odd,avel,ave2,totfc);fclose(fp);)ਭ⚪e84(fgid65⌱ἠá⚪)lᨵ10â100vḄ⌱ἠᦪXᦻ#IN.DAT,ᐸᦪX,ḄᩩãäḄåᙳ10³⊤ç³âḄ⌱èé³´⊤ç³´âḄ⌱èéê!ëìHᑁ`ᙳA0^11⊤ç!â⌱0⊤ç!âí⌱Îî⌱ἠâᦪᜧ5âïfᦔḄ⌱ἠ஺ñO7ᦪReadDat஺Ḅu<⌱ἠᦪX]ᐭᑮAqᦪ.xx஺Trᑴ7ᦪCountRs()ᩭÍ0âḄ⌱ἠᦪ<¤ἠᦪêó,ᐭyyôᑮyy[9]஺<=>yyCDᑮᦻ#OUT.DAT஺IᑖKL+,ᙠᦻ#progl.c஺TUᦋW\7ᦪmain஺ஹ]ᦪX7ᦪReadDal()^CDᦪX7ᦪwriteDat()Ḅᑁ`஺#includecharxx[1001[ll];intyy[10J;

443intReadDat(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][j]==T)count++;if(count>5)continue;for(j=0;j<10;j-H-)if(xx[i][j]=='r)yy[j]++)voidmain()(inti;for(i=0;i<10;i++)yy[i]=O;if(ReadDat()){printf("⌱ἠᦪXᦻ#IN.DATᡭ¨

444\007n);return;)CountRs();WriteDat();)intReadDat(void)(FILE*fp;inti;if<(fp=fopen("IN.DAT",nru))==NULL)return1;for(i=0;i<100;i++){if(fgets(xx[i],l2,fp)==NULL)return1;xx[i][10]=W;)fclose(fp);return0;

445voidWriteDat(void)(FILE*fp;inti;fp=fopen(MOUT.DAT,,,',wn);for(i=0;i<10;i++){fprintf(fp,"©d

446”,yy[i]);printf("³©dâḄ⌱ἠᦪ=%d

447",i+l,yy[i]);}fclose(fp);)ਭ⚪e85(fgid146᦮ᦪᔜᦪ¬1⚪)ÀᦪXᦻ#IN.DAT,ᨵ200$ᦪõ8ᵨ]7ᦪreadDat()<¯Áᦪ,ᐭᦪ.aTὃÃrᑴ7ᦪjsVal(),ᐸuH<$ᦪḄᦪ2ḄÒöᓟᦪ2Ḅ¢ÒöÅᦪ2Ḅᨬ6Òöᓝᦪ2Ḅ᝞>¤DḄᜧ$ᦪᏔᦪᑣÍ0D!ᩩ#Ḅᦪent<¯Á$ᦪᢥ&)ᑮᜧḄ*+,ᐭᦪ.bᨬ68ᵨᑏ7ᦪwriteDat()<=>ent?@ᦪ.bAᔠᩩ#Ḅ$ᦪCDᑮOUT.DATᦻ#஺FGHIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.Ha[200],b[200],NOPQRHentTUᦋWᦪXᦻ#IN.DATḄYZᦪXஹ\7ᦪmain஺ஹ]7ᦪreadDat஺^ᑏ7ᦪwriteDat()Ḅᑁ`஺#include#defineMAX200inta[MAX],b[MAXJ,ent=0;voidjsVal(){inti,j,thou,hun,ten,data,ab,cd;for(i=0;i=0&&a[i]%2==0)b[cnt++]=a[i];)for(i=0;ib[j]){thou=b[i];b[i]=b[j];b[j]=thou;}voidreadDat()inti;

448FILE*fp;fp=fopen(',in.datM,nrn);for(i=0;i

449”,ent);for(i=0;i

450");writeDat();writeDatO(FILE*fp;inti;fp=fopenC'out.dat",nwu);fprintf(fp,"%d

451",ent);for(i=0;i

452n,b[ij);fclose(fp);)ਭਮ⚪e86(fgid140᦮ᦪᔜᡭᦣ.ᔠ¬1⚪)NÀᦪXᦻ#IN.DAT,ᨵ200$ᦪN8ᵨ]7ᦪreadDat஺<¯Áᦪ,ᐭᦪ.aTὃÃrᑴ7ᦪjsVal(),ᐸuH<ᓟᦪ^ᓝᦪ.ᡂḄᦪab(ᓝᦪḄᓝᦪ$ᦪḄᓟᦪᓝᦪḄᦪ$ᦪḄᓝᦪ)?@<ᦪ^Åᦪ.ᡂÆḄH÷ᦪcd(ᦪḄᦪ$ᦪḄᦪᓝᦪḄᦪ$ᦪḄÅᦪ)᝞>.ᡂḄᓝᦪab>cd,abÇÈᏔᦪ5᦮◀cdÇÈ᜻ᦪᦪḄᓝᦪᙳᑣ!ᩩ#Ḅ$ᦪᢥ&ᜧᑮ)Ḅ*+,ᐭᦪ.b⌕0123ᩩ#Ḅ$ᦪḄᦪent,ᨬ6main஺7ᦪ8ᵨᑏ7ᦪwriteDat()<=>ent?@ᦪ.bAᔠᩩ#Ḅ$ᦪCDᑮOUT.DATᦻ#஺FGHIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.:a[200],b[200],NOPQRHentTUᦋWᦪXᦻ#IN.DATḄYZᦪXஹ\7ᦪmain஺ஹ]7ᦪreadDat஺^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#include#defineMAX200inta[MAX],b[MAXJ,ent=0;

453voidjsVal(){inti,j,thou,hun,ten,data;intab,cd;for(i=0;i0&&(ab%2!=1&&ab%5==0)&&cd%2=1&&ab>=10&&cd>=10){b[cnt]=a[i];cnt++;}}for(i=0;i

454”,ent);for(i=0;i

455M);writeDat();writeDat()(FILE*fp;inti;fp=fopenC'out.dat","w");fprintf(fp,n%d

456u,ent);for(i=0;i

457",b[i]);fclose(fp);

458ਭਮ⚪e87(fgid30᦮ᦪᔜ¬1Í0⚪)NÀᦪXᦻ#in.dat,ᨵ300$ᦪN8ᵨ]7ᦪReadDat஺<¯Áᦪ,ᐭᦪ.aTrᑴ7ᦪjsValue(),ᐸuH±Dᓟᦪ2Ḅᦪ£ᦪÅᦪ2Ḅᦪ£ᓝᦪ2ḄᦪḄᦪent,¢±Dᡠᨵ!ᩩ#Ḅ$ᦪÓᙳpjzl,?@!ᩩ#Ḅ$ᦪÓᙳpjz2,ᨬ68ᵨᑏ7ᦪ<=>CDᑮout.datᦻ#஺᝞H6712,6+2=7+1,ᑣ{ᦪᩩ#01Óᙳpjzl,ᦪcnt=cnt+l஺8129,8+9஺1+2,ᑣ{ᦪᩩ#01Óᙳpjz2oIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.Ha[300J,NOPQRHent,pjzl,pjz2஺TUᦋW\7ᦪmain஺ஹ]7ᦪReadDat஺^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#includeinta[300],cnl=0;doublepjz1=0.0,pjz2=0.0;jsValue(){inti,gw,sw,bw,qw,cnt2=0;for(i=0;i<300;i++){gw=a[i]%l0;sw=a[i]/10%10;bw=a[i]/100%10;qw=a[i]/1000;if((qw+gw)==(sw+bw)){cnl++;pjzl+=a[i];}else{cnt2++;pjz2+=a[i];})if(cnt==O)pjz1=0;elsepjzl/=cnt;if(cnt2==0)pjz2=0;elsepjz2/=cnt2;main()(inti;readDat();jsValue();writeDat();printf("cnt=%d

459ᩩ#ḄÓᙳpzjl=%7.2f

460ᩩ#ḄÓᙳpzj2=%7.2f

461'\cnt,pjzl,pjz2);readDat()

462HLE*fp;inti;fp=fopen(nin.datH,"r");for(i=0;i<300;i++)fscanf(fp,',%d,,&a[i]);fclose(fp);)writeDat()(FILE*fp;inti;fp=fopen("out.dat',,,,wn);fprintf(fp,M%d

463%7.2f

464%7.2f

465n,cnt,pjzl,pjz2);fclose(fp);}⚪e88(fgid66Aq᣸+⚪)7ᦪReadDat஺kl&ᦻ#IN.DAT]mnoᦻᦻp,ᐭᑮAqᦪ.xxTrᑴ7ᦪSortCharAO,ᐸ7ᦪḄuH?vᓫ¥Aᢥ&)ᑮᜧḄ*+ºv᣸+᣸+6Ḅ=>}ᢥv,ᐭAqᦪ.xxᨬ68ᵨ7ᦪwriteDat஺<=>xxCDᑮᦻ#OUT1.DAT஺HᦻHdAe,BfC.CCbbAA=>H.ABCdefAACCbbᦪXᦻ#,ḄHvḄᙳ)80A᪗A^஺IᑖKL+,ᙠᦻ#progl.c஺TUᦋW\7ᦪmain஺ஹ]ᦪX7ᦪReadDat()^CDᦪX7ᦪwriteDat()Ḅᑁ`஺#include#include#includecharxx[50][80];intmaxline=0;/*ᦻpḄvᦪ*/intReadDat(void);voidWriteDat(void);voidSortCharA(void){inti,j,k,strl;charch;for(i=0;i

466for(k=j+l;kxx[i][k]){ch=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=ch;})voidmain()(clrscr();if(ReadDat()){printf("ᦪXᦻ#IN.DATᡭ!

467\007n);return;)SortCharA();WriteDat();iniReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopenCIN.DATH,Hr"))==NULL)return1;while(fgets(xx[i],8O,fp)!=NULL){p=strchr(xx[ij/

468,);if(p)*p=O;i++)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;clrscr();fp=fopen("OUTl.DATH,Hw");for(i=0;i

469”,xx[i]);fprintf(fp,H%s

470H,xx[i]);

471fclose(fp);ਮ⚪e89(fgid147᦮ᦪÍ0᣸+⚪)NÀᦪXᦻ#IN.DAT,ᨵ200$ᦪN8ᵨ]7ᦪreadDat஺<¯Áᦪ,ᐭᦪ.aTὃÃrᑴ7ᦪjsVal(),ᐸuH<$ᦪḄᓟᦪ2Ḅ£2ᦪ2ḄាÌÅᦪ2Ḅ£2ᦪ2Ḅ$ᦪ᜻ᦪᑣÍ0D!ᩩ#Ḅᦪent<¯Á$ᦪᢥ&)ᑮᜧḄ*+,ᐭᦪ.bᨬ68ᵨᑏ7ᦪwriteDat()<=>ent?@ᦪ.bAᔠᩩ#Ḅ$ᦪCDᑮOUT.DATᦻ#஺FGHIᑖKL+,ᙠᦻ#progl.c஺L+NOPᦪ.:a[200],b[200],NOPQRHentTUᦋWᦪXᦻ#IN.DATḄYZᦪXஹ\7ᦪmain஺ஹ]7ᦪreadDat()^ᑏ7ᦪwriteDat஺Ḅᑁ`஺#include#defineMAX200inta[MAX],bfMAX],ent=0;voidjsVal()(inti,j,gw,sw,bw,qw;for(i=0;ib[j]){qw=b[i];b[i]=b[j];b[j]=qw;)}voidreadDat()(inti;FILE*fp;fp=fopen(',in.dat,\Mrn);for(i=0;i

472jsVal();printf("ᩩ#Ḅᦪ=%d

473”,ent);for(i=0;i

474H);writeDat();writeDat()(FILE*fp;inti;fp=fopen("out.datn,"wu);fprintf(fp,"%d

475",ent);for(i=0;i

476n,b[i]);fclose(fp);I⚪e90(fgid18᦮ᦪ᣸+⚪)ÚᑡL+ḄuH-ú᦮ᦪ+ᑡ{K1,K2.…K9}᣸ᑡᡂ•Ḅ+ᑡ஺+ᑡûK1)ḄᦪüᙠK1Ḅý☢(☢)ûK1ᜧḄᦪüᙠK1Ḅ6☢(ÿ☢)஺⌕ᑏᦪjsValue()ᨬᵨwriteDat()ᦪᑡᑮᦻout.dat஺ᙠ!"#$10&ᑡ'&ᑡᨵ9&)᦮ᦪ+,ᐭᦪ.a[10N9]ᑖ0110&ᑡ஺23£6,8,9,125,4,7,3}45᣸ᡂ8{3,4,5,2,1,6,8,9,7}:ᑖ;!,ᙠᦻprogl.c஺<=ᦋ?@ᦪmain஺AᑏᦪwriteDat()ḄᑁD஺#includejsValue(inta[10][9]){inti,j,k,val,num;for(i=0;i<10;i++){val=a[iJ[OJ;for(j=0;j<9;j++)if(a[i][j]0;k-)a[i][k]=a[i][k-l];a[iJlO]=num;

477main()(inta[10][9]={{6,8,9,l,2,5,4,7,3),{3,5,8,9,1,2,647},{821,9,3,5,4,6,7},{3,5,1,2,9,867,4},{4,7,8,9,1,2,536},{4,7,3,5,126,8,9},{9,1,3,5,8,624,7},{2,61,9,8,3,5,7,4},{5,3,7,9,1,826,4},{7E,3,2,5,8,9,4,6},)Finti,j;jsValue(a);for(i=0;i<10;i++){for(j=0;j<9;j++){printf("%d",a[i][j]);if(j<=7)printf(",");)printf("

478");)writeDat(a);writeDat(inta[10][9])(FILE*fp;inti,j;fp=fopen("out.dat","w");for(i=0;i<10;i++){for(j=0;j<9;j++){printf("%d",a[i][j]);fprintf(fp,"%d",a[i]|j]);if(j<=7)fprintf(fp,",");)printf("

479");fprintf(fp,"

480");)fclose(fp);

481⚪H91IJid52᦮ᦪKLMN⚪O<ᑴ!progl.c,Qᦻin.datRS200&᦮ᦪTᦪ.xx᜻ᦪḄ&ᦪcntlAᏔᦪḄ&ᦪcnt2WXᦪ.xxY᪗8ᏔᦪḄᐗ\]ḄN^_ᙳ]pjabᶇ2deᦪO஺fgcntl,cnt2,pjᑮout.dat஺:ᑖ!ஹRᦪiᦪread_datintxx[200JXjkl#஺#include#include#defineN200voidread_dat(intxx[N])inti,j;FILE*fp;fp=fopen("in.dat',,uru);for(i=0;i<20;i++){for(j=0;j<10;j++){fscanf(fpF'%dF\&xx[i*10+j]);printf(n%d'\xx[i*10+j]);printf(n

482H);fclose(fp);)voidmain()inti,j,sum;intcntl,cnt2,xx[N];floatpj;FILE*fw;clrscr();fw=fopen(',out.datn,',wn);read_dat(xx);sum=0;pj=O.O;cntl=cnt2=0;for(i=0;i

483printf("

484

485cntl=%d,cnt2=%d,pj=%6.21

486",cntl,cnt2,pj);fprintf(fw,n%d

487%d

488%6.2f

489",cntl,cnt2,pj);fclose(fw);ਮ⚪H92aIJid56᦮ᦪKLMN⚪O<ᑴ!progl.c,QᦻIN.DATRS200&᦮ᦪTᦪ.xxᨬᜧᦪmaxXᨬᜧᦪḄ&ᦪentAᦪ.xxo3᦮◀ᡈo7᦮◀ḄN^_ᙳ]pjabᶇ2deᦪO஺fgmax,cnt,pjᑮOUT.DAT஺:ᑖ!ஹRᦪiᦪread_datintxx[200]Xjk"#஺#include#include#defineN200voidread_dat(intxx[N])inti,j;FILE*fp;fp=fopen(”in.dat",T');for(i=0;i<20;i++){for(j=0;j<10;j++){fscanf(fp,n%d,n,&xx[i*10+j]);printf(n%dM,xx[i*10+j]);printf(n

490");fclose(fp);}voidmain()intm,temp,n,sum;intcnt,xx[N],max;floatpj;FILE*fw;clrscr();fw=fopen(,'out.datn,',wn);read_dat(xx);cnt=0;max=xx[01;pj=O.O;n=0;for(m=0;m

491if(max

492

493max=%d,cnt=%d,pj=%6.2i'

494',,max,cnt,pj);fprintf(fw,"%d

495%d

496%6.2f

497",max,cnt,pj);fclose(fw);)ਭ⚪H93(IJid59tuMN⚪)⚪ᓭw᪗xyzᨵ{|<ᑴᦪReadDat஺QᦻIN.DATRS1000&ᓝ~ᑴ᦮ᦪᑮᦪ.xxF<ᑴᦪCompute(),ᑖ0LNxx᜻ᦪḄ&ᦪodd,ᏔᦪḄ&ᦪeven,_ᙳ]averWXtutotfcḄ]ᨬᵨᦪWriteDat஺fgᑮOUT.DATᦻ஺LNtuḄk᝞YN2totfc=l/N£(xx[i]-aver)i=lᦪiᦻ,Ḅjk',10&ᦪ+ᵨ⌹◞w஺('&ᦪᙳᜧ0e2000):ᑖ;!,ᙠᦻprogl.c஺<=ᦋ?@ᦪmain஺AᦪiᦪwriteDat()ḄᑁD஺#include#include#include#defineMAX1000intxx[MAXJ,odd=0,even=0;doubleaver=0.0,totfc=0.0;voidWriteDat(void);intReadDat(void)(inti;FILE*fp;if((fp=fopen(HIN.DAT","ru))==NULL)return1;

498for(i=0;i

499");fclose(fp);return0;voidCompute(void){inti;for(i=0;i

500")Freturn;)Compute();printf(HODD=%d

501OVEN=%d

502AVER=%f

503TOTFC=%f

504",odd,even,aver,totfc);WriteDatQ;voidWriteDat(void)(FILE*fp;inti;fp=fopen(,,OUT.DAT',,"wn);

505fprintf(fp,M%d

506%d

507%f

508%f

509",odd,even,aver,totfc);fclose(fp);)ਭ⚪H94(IJid50᦮ᦪKLMN⚪)<ᑴ!progl.c,Qᦻin.datRS200&᦮ᦪTᦪ.xx᜻ᦪḄ&ᦪcntlAᏔᦪḄ&ᦪcnt2WXᦪ.xx]8ᏔᦪḄN^_ᙳ]pj(bᶇ2deᦪ)஺fgcntl,cnt2,pjᑮout.dat஺:ᑖ!ஹRᦪiᦪread_dat(intxx[200])XjkJ#஺#include#include#defineN200voidread_dat(inlxx[N])(inti,j;FILE*fp;fp=fopen("in.datM,nr");for(i=0;i<20;i++){for(j=0;j<10;j++){fscanf(fpF'%d,n,&xx[i*10+j]);printf("%d",xx[i*10+j]);)printf("

510n);}fclose(fp);)voidmain()(intm,sum;intcntl,cnt2,xx[N];floatpj;FILE*fw;fw=fopen(nout.dat,,,',wn);clrscr();read_dat(xx);ent1=0;cnt2=0;pj=O.O;for(m=0;m

511else{cnt2++;pj+=xx[m];}if(cnt2==0)pj=O;elsepj/=cnt2;printf(n

512

513cnt1=%d,cnt2=%d,pj=%6.2f

514",cnt1,cnt2,pj);fprintf(fw,',%d

515%d

516%6.2f

517,',cntl,cnt2,pj);fclose(fw);)⚪H95(IJid7ᣚ⚪)ᦪReadDat()QᦻENGINRSᦻᦻ,ᐭᑮᦪ.xxF<ᑴᦪencryptChar(),ᢥ#Ḅᐵᦪ.xxḄᡠᨵ~¡,ᐭᦪ.xxḄ¢Ḅd£lᨬᵨᦪWriteDat஺fgxxᑮᦻPS4.DA஺ᐵf(p)=p*llmod256(pᦪ.¤&ḄASCII]f(p)LNḄASCII])᝞gLNf(p)]e32ᡈf(p)¢Ḅᜧᑏ¥ᑣ§¨ᔲᑣf(p)ᡠ¢Ḅ~஺:ᑖ;!,ᙠᦻprogl.c஺ᦪiᦻ,Ḅjk'Ḅª«ᙳe80&஺<=ᦋ?@ᦪmain஺ஹRᦪiᦪReadDat()AᦪiᦪWriteDat()ḄᑁD஺#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻḄ¬ᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,jFfor(i=0;i=,A'&&xx[i]fj]*ll%256<=,Z,)continue;elsexx[ij|jj=xxlij[jj*l1%256;voidmain()(clrscr();if(ReadDat()){printf("ᦪiᦻENGINᡭw!

518\007H);return;

519encryptChar();WriteDat();)intReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(,'eng.in,,,ur,,))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]”)Fif(p)*p=O;i++F)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(',ps4.dat',,,'wu);for(i=0;i

520”,xx[i]);fprintf(fp,n%s

521",xx[i]);)fclose(fp);}⚪±ᨵ²³yztz´µ⚪8ਭ⚪H96(IJid87ᣚ⚪)ᦪReadDat஺QᦻENG.INRSᦻᦻ,ᐭᑮᦪ.xxF<ᑴᦪencryptChar஺ᢥ#Ḅᐵᦪ.xxḄᡠᨵ~¡,ᐭᦪ.xxḄ¢Ḅd£lᨬᵨᦪWriteDat()fgxxᑮᦻPS5.DAT஺ᐵf(p)=p*llmod256(pᦪ.¤&ḄASCII]f(p)LNḄASCII])᝞gLNf(p)]e32ᡈf(p)¢Ḅeᑏ¥ᑣ§¨ᔲᑣf(p)ᡠ¢Ḅ~஺:ᑖ;!,ᙠᦻprogl.c஺ᦪiᦻ,Ḅjk'Ḅª«ᙳe80&஺

522<=ᦋ?@ᦪmain()>RᦪiᦪReadDat஺AᦪiᦪWriteDat஺ḄᑁD஺#include#include#include#includeunsignedcharxx[50][80];intmaxline=O;/*ᦻḄ¬ᦪ*/iniReadDat(void);voidWriteDat(void);voidencryptChar(){inti,jFfor(i=0;i='a,&&xx(il[jFll%256<='z')continue;elsexx[i][j]=xx[i][j]*ll%256;voidmain()(clrscr();if(ReadDat()){printf("ᦪiᦻENGINᡭw|

523\007”);return;)encryptChar();WriteDat();}intReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(,,eng.inH,uru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[ij,,

524,);if(p)*p=O;i++Fmaxline=i;

525fclose(fp);return0;voidWriteDat(void)(FILE*fp;inti;fp=fopen(',ps5.dat',F'wu);for(i=0;i

526H,xx[i]);fprintf(fp,"%s

527",xx[i]);)fclose(fp);}⚪±ᨵ²³yztz´µ⚪8ਭਮ⚪H97(IJid91ᣚ⚪)ᦪReadDat()QᦻENGINRSᦻᦻ,ᐭᑮᦪ.xxF<ᑴᦪencryptChar(),ᢥ#Ḅᐵᦪ.xxḄᡠᨵ~¡,ᐭᦪ.xxḄ¢Ḅd£lᨬᵨᦪWriteDat஺fgxxᑮᦻPS9.DAT஺ᐵf(p)=p*llmod256(pᦪ.¤&ḄASCH]f(p)LNḄASCII])᝞gᦪ0T9ᡈLNf(p)]e32,ᑣ§¨ᔲᑣf(p)ᡠ¢Ḅ~஺:ᑖ;!,ᙠᦻprogl.c஺ᦪiᦻ,Ḅjk'Ḅª«ᙳe80&஺<=ᦋ?@ᦪmain஺ஹRᦪiᦪReadDat()AᦪiᦪWriteDat஺ḄᑁD஺#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻḄ¬ᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,jFfor(i=0;i='0,&&xxfi][j]<=,9')continue;elsexx[ij|jj=xxlij[jj*l1%256;

528voidmain()(clrscr();if(ReadDat()){printf("ᦪiᦻENGINᡭw|

529\007n);return;)encryptChar();WriteDat();)intReadDat(void)(FILE*fp;inti=0;unsignedchar*p;if((fp=fopen(neng.in'7'r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i]/

530*);if(p)*p=O;i++F)maxline=i;fclose(fp);return0;)voidWriteDat(void)(HLE*fp;inti;fp=fopen(',ps9.dat,,,,'wu);for(i=0;i

531n,xx[i]);fprintf(fp,"%s

532",xx[i]);)fclose(fp);}⚪±ᨵ²³yztz´µ⚪8⚪H98IJid85⚪O

533(IJid85¶ᐵᦋ8$f(p)=p*llmod256))ᦪReadDat஺QᦻENG.INRS•ᦻᦻ,ᐭᑮᦪ.xxF<ᑴᦪencryptChar(),ᢥ#Ḅᐵᦪ.xxḄᡠᨵ~¡,ᐭᦪ.xxḄ¢Ḅd£ᓃᨬᵨᦪWriteDat஺fgxxᑮᦻPS3.DAT஺ᐵf(p)=p*I7mod256(pᦪ.¤&ḄASCH]f(p)LNḄASCH])᝞gLNf(p)]e32ᡈᐸASCII]᜻ᦪᑣ§¨ᔲᑣf(p)ᡠ¢Ḅ~஺:ᑖ;!,ᙠᦻprogl.c஺ᦪiᦻ,Ḅjk'Ḅª«ᙳe80&஺<=ᦋ?@ᦪmain஺ஹRᦪiᦪReadDat஺AᦪiᦪWrileDat஺ḄᑁD஺#include#include#include#includeunsignedcharxx[50][80];intmaxline=0;/*ᦻḄ¬ᦪ*/intReadDat(void);voidWriteDat(void);voidencryptChar(){inti,j;for(i=0;i

534\007");return;)encryptChar();WriteDat();intReadDat(void)(FILE*fp;inti=0;

535unsignedchar*p;if((fp=fopen(,'eng.in,',,,r,,))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],

536*)Fif(p)*p=O;i++F)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen("ps3.dat',,,'wu);for(i=0;i

537",xx[i]);fprintf(fp,'1%s

538n,xx[i]);)fclose(fp);}⚪±ᨵ²³yztz´µ⚪8ਭ⚪H99(IJid74f᪀¼᣸ᑡ⚪)"½ᙠᦻIN.DAT,ᨵ100&¾¿├ÁÂÃ'&¾¿├ÁÂÃᵫ¾¿ṹdm(Æ4d)¾¿ÇÈme(Æ10d)ᓫÊdj(᦮Æ)ᦪËsi(᦮Æ)ÌÍje(Î᦮Æ)Ï:ᑖ.ᡂ஺ᐸÌÍ=ᓫÊ*ᦪËLNÑ஺ᦪReadDat஺RS1100&├ÁÂÃ+,ᐭf᪀ᦪ.sell஺<ᑴᦪSortDat஺ᐸ⌕ᢥÌÍQeᑮᜧ~᣸ᑡÒÌÍÓᑣᢥ¾¿ṹQeᑮᜧ~᣸ᑡᨬÔ᣸ᑡfg¡,ᐭf᪀ᦪ.sellᨬᵨᦪWriteDat஺fgᑮᦻOUTLDAT஺:ᑖ;!,ᙠᦻprogl.c஺<=ᦋ?@ᦪmain஺ஹRᦪiᦪReadDat()AᦪiᦪWriteDat()ḄᑁD஺#include#include#include#include#include#defineMAX100typedefstruct{

539chardm[5J;/*¾¿ṹ*/charmc[U]஻*¾¿ÇÈ*/intdj;/*ᓫÊ*/intsi;/*ᦪË*/longje;/*ÌÍ*/}PRO;PROsell[MAX];voidReadDat();voidWriteDat();voidSortDat(){intij;PROxy;for(i=0;i<99;i++)for(j=i+l;j<100;j++)if(sell[i].je>sell[j].jellsell[i].je==sell[j].je&&strcmp(sell[i].dm,sell[j].dm)>O){xy=sell[i];sell[i]=sellfj];sell[j]=xy;})voidmain()(memset(sell,0,sizeof(sell));ReadDat();SortDat();WriteDat();)voidReadDat()(FILE*fp;charstr[8O],ch[ll];inti;fp=fopen(,,IN.DAT,,,',rn);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);chf5]=0;sell[i].sl=atoi(ch);sell[i].je=(long)sell[i].dj*sell[i].si;

540fclose(fp);voidWriteDat()(HLE*fp;inti;fp=fopen("OUTl.DAT","w");for(i=0;i<100;i++){printf(H%s%s%4d%5d%5d

541”sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);fprintf(fpF'%s%s%4d%5d%5d

542"sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,sell[i].je);)fclose(fp);)ਭ⚪H100(IJid21ᣚ⚪)ᦪReadDat஺QᦻIN.DATRS•ᦻᦻ,ᐭᑮᦪ.xx<ᑴᦪCharConvA(),ᐸᦪḄW8ᓫdḄᨬ&ḄASCH]Ö×4dØᨬÙÚ&ḄASCII]Ñᑮᨬ&ḄᨬÙÚ&ḄASCII]Ö×4dØᨬÙÛ&ḄASCII]ÑᑮᨬÙÚ&ḄÜÝÞßᜐᳮᑮÙÚ&Ù&ḄASCII]Øᨬ&ḄASCII]ÑᑮÙ&ḄÑᑮḄᑖ0,ᙠ¢Ḅd£l஺ᨬ"ᜐᳮḄ¡ᢥ5,ᐭᦪ.xxᨬᵨᦪwriteDat஺fgxxᑮᦻOUT10.DAT஺ᦪiᦻ,Ḅjk'Ḅª«ᙳe80&â᪗ãAäj஺:ᑖ;!,ᙠᦻprogl.c஺<=ᦋ?@ᦪmain()AᑏᦪwriteDat஺ḄᑁD஺#include#include#includecharxx[50][80J;intmaxline=0;/*ᦻḄ¬ᦪ*/intReadDat(void);voidWriteDat(void);voidCharConvA(){inti,j;charp,c;for(i=0;iO;j-)

543xx[i][j]=(xx[i][j]»4)+xx[i][j-l];xx[i][O]=p+c;))voidmain()(clrscr();if(ReadDat()){printf("ᦪiᦻIN.DATᡭw|

544\007n);return;)CharConvA();WriteDat();intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen(,,IN.DAT,,F'ru))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[ij,,

545,);if(p)*p=O;i++F)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen("OUT10.DAT“Jw")Ffor(i=0;i

546”,xx[i]);fprintf(fp,"%s

547",xx[il);)fclose(fp);

548⚪⊡ᐙᦪReadDat஺QᦻENG.INRS•ᦻᦻ,ᐭᑮᦪ.xxF<ᑴᦪDelWord()ᑖ0ᢥᑤ◀äjஹ᪗ãè+'Ḅᓫéᢥᓣ᣸ë,ìᦪ.XXᨬᵨᦪWriteDat஺fgxxᑮᦻPS6.OUT஺ᦪiᦻ,Ḅjk'Ḅª«ᙳe80&â᪗ãAäj஺íî:ᑖ;!,ᙠᦻprogLc஺ᦻ'Ḅᓫéïᓫéðñᵨäjᡈᐸò᪗ãᑖ◞'ᓫéᙳe20&஺<=ᦋ?@ᦪmain஺ஹRᦪiᦪReadDat஺AᦪiᦪWriteDat஺ḄᑁD஺#include#include#include#includecharxx[50][801;intmaxline=0;/*ᦻḄ¬ᦪ*/intReadDat(void);voidWriteDat(void);voidDelWord(void){inti,j,k,m,cnt;char*p,word[20],str[80][20],abc[80];for(i=0;i0){strcpy(word,str|jj);strcpy(str|jj,str[mj);strcpy(str[in],word);}for(j=0;j

549voidmain()(clrscr();if(ReadDat()){printf("ᦪiᦻENGINᡭw!

550\007”);return;)DelWord();WriteDat();)intReadDat(void)(FILE*fp;inti=0;char*p;if((fp=fopen("eng.in",Y'))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){p=strchr(xx[i],,

551');if(p)xx[i][p-xx[i]]=0;i++F)maxline=i;fclose(fp);return0;)voidWriteDat(void)(FILE*fp;inti;fp=fopen(',ps6.outn,"w");for(i=0;i

552",xx[i]);fprintf(fp,,"%s

553M,xx[i]);)fclose(fp);}eng.in(ᐭᦻ)ISAMenhancesthefunctionalityofyourprogramsthroughits

554flexibility.Ifyouaddasectiontoabook,removeafewpages,orrearrangeparagraphsorsections,youhavetorecreateyourindex,sincethekeywordsmustappearinrelationtoeachother.Inthiscase,therelationshipofthekeywordstoeachotherisalphabeticorder.AISAMindexchangesautomatianemployee,orchangeanythinginarecord,ISAMimmediatelyupdatesallindexes.Youcancreateanindexonanyfield,onseveralfieldstobeusedtogether,oronpartsthereof,thatyouwanttouseasakey.ThekeysinindexesallowyouquickaccesstospecificrecordsanddefineordersforsequentialprocessingofaISAMfile.Afteryounolongerneedanindex,youcandeleteit.Additionandindexeshavenoeffectonthedatarecordsoronotherindexes.Youmaywantafieldinfieldineachrecordtouniquelyidentifythatrecordfromallotherrecordsinthefile.Forexample,theEmployeeNumberfieldisuniqueifyoudonotassignthesamenumbertotwodifferentemployees,andyouneverreassignthesenumberstootheremployees.Ifyouwishtofindormodifytherecordbelongingtoaspecificemployee,thisuniquefieldsavesthethoubleofdeterminingwhetheryouhavethecorrectrecord.Ifyoudonothaveauniquefield,youmustfindthefirstrecordthematchesyourkeyanddeterminewhethertherecordistheoneyouwant.Ifitisnotthecorrectone,youmustsearchagaintofindothers.Ifyouknowthatyouhaveauniquefieldwithinyourrecords,youcanincludethisfactinthekeydescription,andISAMwillallowonlyuniquekeys.Forexample,ifyouspecifythattheemployeenumbersareunique,ISAMonlyletsyouaddrecordstothefilefor,orchangenumbersto,employeenumbersthatdonotalreadlyexistintfile.ps6.outaᦻOISAMenhancesfunctionalityitsofprogramsthethroughyourIfaaaaddbookfewflexibilitypagesremovesectiontoyouhaveororparagraphsrearrangerecreatesectionstoyouyourappeareachinindexkeywordsmustotherrelationsincethetoIncaseeachiskeywordsofotherrelationshipthethethistoAISAMalphabeticautomatianchangesemployeeindexororderISAMaallanythingchangeimmediatelyinindexesrecordupdatesYouananybecancreatefieldfieldsindexononseveraltousedTheaaskeyonoipartsthatthereoftotogetherusewantyouaccessallowanddefineinindexeskeysquickrecordsspecifictoyouAfterlSAMafileforlongernoofordersprocessingsequentialyouAdditionanandcandeleteeffecthaveindexindexesitneednoyoudataindexesononorotherrecordstheYouaeachfieldfieldidentifyininmayrecordthattouniquelywantEmployeeForallexamplefilefrominotherrecordrecordsthethe

555NumberassigndofieldifisnotnumbersamethetotwouniqueyouanddifferentemployeesnevernumbersotherreassignthesetoyouIfabelongingemployeesfindmodifyorrecordthetotowishyoudeterminingemployeefieldofsavesspecificthethisthoubleuniquecorrecthaverecordthewhetheryouIfadofieldfindfirsthavemustnotrecordtheuniqueyouyouanddetermineiskeymatchesonerecordthethethewhetheryouyourIfagaincorrectfindisitmustnotoneotherssearchthetowantyouIfafieldhaveknowrecordsthatuniquewithinyouyouyouyourISAMallowandcandescriptionfactinincludekeyonlythethiswillForareemployeeexampleifkeysnumbersspecifythattheuniqueyouISAMaddchangefileforletsonlyorrecordsthetouniqueyouAlreadlydoemployeeexistfileintnotnumbersnumbersthatto

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
关闭