計(jì)算機(jī)三級(jí)上機(jī):適用于三級(jí)網(wǎng)絡(luò)技術(shù)、數(shù)據(jù)庫(kù)等_第1頁(yè)
計(jì)算機(jī)三級(jí)上機(jī):適用于三級(jí)網(wǎng)絡(luò)技術(shù)、數(shù)據(jù)庫(kù)等_第2頁(yè)
計(jì)算機(jī)三級(jí)上機(jī):適用于三級(jí)網(wǎng)絡(luò)技術(shù)、數(shù)據(jù)庫(kù)等_第3頁(yè)
計(jì)算機(jī)三級(jí)上機(jī):適用于三級(jí)網(wǎng)絡(luò)技術(shù)、數(shù)據(jù)庫(kù)等_第4頁(yè)
計(jì)算機(jī)三級(jí)上機(jī):適用于三級(jí)網(wǎng)絡(luò)技術(shù)、數(shù)據(jù)庫(kù)等_第5頁(yè)
已閱讀5頁(yè),還剩175頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

**********************************☆題目1文件中。intisP(intm){inti;for(i=2;i<m;i++)if(m%i==0)return0;return1;}voidnum(intm,intk,intxx[]){ints=0;for(m=m+1;k>0;m++)if(isP(m)){xx[s++]=m;k--;}}{printf("%d",xx[m]);printf("\n");}{FILE*rf,*wf;rf=fopen("","r");wf=fopen("","w");for(i=0;i<10;i++){formmnm+)fprintf(wf,"%d",xx[m]);fprintf(wf,"\n");}}*********************************☆題目2注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j,qw,bw,sw,gw;for(i=0;i<MAX;i++){qw=a[i]/1000;bw=a[i]/100%10;sw=a[i]%100/10;gw=a[i]%10;if(qw&&qw%2==0&&bw%2==0&&sw%2==0&&gw%2==0)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]<b[j]){qw=b[i];b[i]=b[j];b[j]=qw;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}*********************************★題目3單位依次把字符串中所有小寫字母o左邊的字符串內(nèi)容移到該串的右邊存放,然后把小寫字母o刪除,余下的字符串內(nèi)容放的格式是:每行的寬度均小于80個(gè)字符,含標(biāo)點(diǎn)符號(hào)和空格。注意:部分源程序存放在文件中。tintmaxline=0;/*文章的總行數(shù)*/dvoidStrOR(void){inti,righto,j,s,k;chartem[80];for(i=0;i<maxline;i++)for(j=strlen(xx[i])-1;j>=0;j--){k=0;if(xx[i][j]=='o'){righto=j;for(s=righto+1;s<strlen(xx[i]);s++)tem[k++]=xx[i][s];for(s=0;s<righto;s++)if(xx[i][s]!='o')tem[k++]=xx[i][s];strcpy(xx[i],tem);}}}{printf("數(shù)據(jù)文件不能打開!\n\007");}}{FILE*fp;inti;iffpfopenr==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){inif(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}**********************************位對(duì)行中以空格或標(biāo)點(diǎn)符號(hào)為分隔的所有單詞進(jìn)行倒排。最后把已處理的字符串(應(yīng)不含標(biāo)點(diǎn)符號(hào))仍按行重新存入字符放的格式是:每行的寬度均小于80個(gè)字符,含標(biāo)點(diǎn)符號(hào)和空格。文件中。intmaxline=0;/*文章的總行數(shù)*/voidStrOL(void){inti,j,k,s,m,strl;charstr[80];for(i=0;i<maxline;i++){strl=strlen(xx[i]);for(j=strl-1;j>=0;j--){if(isalpha(xx[i][j]))k++;else{for(m=1;m<=k;m++)str[s++]=xx[i][j+m];k=0;}if(!isalpha(xx[i][j]))str[s++]='';}for(m=1;m<=k;m++)str[s++]=xx[i][j+m];str[s]='\0';strcpy(xx[i],str);}}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}**********************************jsSort(),其函數(shù)的功能是:要求按每個(gè)數(shù)的后三位的大小進(jìn)行升序排列,然后取出滿足此條件的前10個(gè)數(shù)依次存入數(shù)組文件中。tvoidjsSort(){inti,j,data;for(i=0;i<199;i++)for(j=i+1;j<200;j++)if(aa[i]%1000>aa[j]%1000||aa[i]%1000==aa[j]%1000&&aa[i]<aa[j]){data=aa[i];aa[i]=aa[j];aa[j]=data;}for(i=0;i<10;i++)bb[i]=aa[i];}{}{FILE*in;inti;in=fopen("","r");}{FILE*out;inti;for(i=0;i<10;i++){printf("%d",bb[i]);fprintf(out,"%d\n",bb[i]);}}*********************************jsSort(),其函數(shù)的功能是:要求按每個(gè)數(shù)的后三位的大小進(jìn)行降序排列,然后取出滿足此條件的前10個(gè)數(shù)依次存入數(shù)組b注意:部分源程序已給出。tvoidjsSort(){inti,j,data;for(i=0;i<199;i++)for(j=i+1;j<200;j++)if(aa[i]%1000<aa[j]%1000||aa[i]%1000==aa[j]%1000&&aa[i]>aa[j]){data=aa[i];aa[i]=aa[j];aa[j]=data;}for(i=0;i<10;i++)bb[i]=aa[i];}{}{FILE*in;inti;in=fopen("","r");}{FILE*out;inti;for(i=0;i<10;i++){printf("i=%d,%d\n",i+1,bb[i]);fprintf(out,"%d\n",bb[i]);}}******************************售記錄并存入結(jié)構(gòu)數(shù)組sell中。請(qǐng)編制函數(shù)SortDat(),其功能要求:按產(chǎn)品代碼從大到小進(jìn)行排列,若產(chǎn)品代碼相同,則文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];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)<0||strcmp(sell[i].dm,sell[j].dm)==0&&sell[i].je<sell[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<100;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<100;i++){}}*********************************函數(shù)ReadDat()實(shí)現(xiàn)從文件中讀取一篇英文文章,存入到字符串?dāng)?shù)組xx中;請(qǐng)編制函數(shù)encryptChar(),按給定的替代關(guān)系txxp序存在文件中。原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于80個(gè)字符。tintmaxline=0;/*文章的總行數(shù)*/voidencryptChar(){inti,j;for(i=0;i<maxline;i++)for(j=0;j<strlen(xx[i]);j++)if(xx[i][j]*11%256<=32||xx[i][j]*11%256>130)continue;elsexx[i][j]=xx[i][j]*11%256;}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}*********************************放的格式是:每行的寬度均小于80個(gè)字符,含標(biāo)點(diǎn)符號(hào)和空格。文件中。intmaxline=0;/*文章的總行數(shù)*/voidSortCharD(void){inti,j,k,strl;archfor(i=0;i<maxline;i++){strl=strlen(xx[i]);for(j=0;j<strl-1;j++)for(k=j+1;k<strl;k++)if(xx[i][j]<xx[i][k]){ch=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=ch;}}}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}********************************ReadDat組xx中,請(qǐng)編制函數(shù)ConvertCharA(),其函數(shù)的功能是:以行為單位把字符串中的所有小寫字母改寫成該字母的下一個(gè)字母,如果是字母z,則改寫成字母a。大寫字母仍為大寫字放的格式是:每行的寬度均小于80個(gè)字符,含標(biāo)點(diǎn)符號(hào)和空格。文件中。intmaxline=0;/*文章的總行數(shù)*/voidConvertCharA(void){inti,j;for(i=0;i<maxline;i++){for(j=0;j<strlen(xx[i]);j++)if(xx[i][j]=='z')xx[i][j]='a';elseif(xx[i][j]>='a'&&xx[i][j]<='y')xx[i][j]+=1;}}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}**********************************小寫字母仍為小寫字母,其它字符不做改變。注意:部分源程序存在文件文件中。{intI;for(I=0;I<strlen(s);I++)if(s[i]=='z'||s[i]=='Z')s[i]-=25;elseif(s[i]>='a'&&s[i]<='y'||s[i]>='A'&&s[i]<='Y')s[i]+=1;}{a}{inti;FILE*rf,*wf;rf=fopen("","r");wf=fopen("","w");foriii++){sna}f}********************************文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];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)>0||strcmp(sell[i].mc,sell[j].mc)==0&&sell[i].je>sell[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<100;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<100;i++){}}*****************************品代碼從小到大進(jìn)行排列,若產(chǎn)品代碼相等,則按金額從大到小進(jìn)行排列,最終排列結(jié)果仍存入結(jié)構(gòu)數(shù)組sellt文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];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)>0||strcmp(sell[i].dm,sell[j].dm)==0&&sell[i].je<sell[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<100;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<100;i++){}}*****************************atb注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j,flag;for(i=0;i<MAX-5;i++){for(j=i+1;j<=i+5;j++)if(a[i]>a[j]&&a[i]%2)flag=1;reakif(flag==1)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]>b[j]){flag=b[i];b[i]=b[j];b[j]=flag;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}************************)是:若一個(gè)四位數(shù)的千位數(shù)字上的值小于等于百位數(shù)字上的值,百位數(shù)字上的值小于等于十位數(shù)字上的值,以及十位數(shù)字注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j;for(i=0;i<MAX;i++){qw=a[i]/1000;bw=a[i]%1000/100;sw=a[i]%100/10;gw=a[i]%10;if((qw<=bw)&&(bw<=sw)&&(sw<=gw)&&(a[i]%2==0))b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]>b[j]){qw=b[i];b[i]=b[j];b[j]=qw;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}******************************放的格式是:每行的寬度均小于80個(gè)字符,含標(biāo)點(diǎn)符號(hào)和空格。文件中。intmaxline=0;/*文章的總行數(shù)*/voidStrCharJR(){inti,j;for(i=0;i<maxline;i++)for(j=0;j<strlen(xx[i]);j++)xx[i][j]+=(xx[i][j]>>4);}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}*************************READDAT讀取一篇英文文章存入到字符串?dāng)?shù)組XX中;請(qǐng)編制函數(shù)CHA(),其函數(shù)功能是:以行為單位把字符串中的第一個(gè)字符的ASCII值加第二個(gè)字符的ASCII值,得到第一個(gè)親朋字符,第二個(gè)字符的ASCII值加第三個(gè)字值,得到最后一個(gè)新的字符,得到的新字符分別存放在原字符串對(duì)應(yīng)的位置上。最后把已處理的字符串逆轉(zhuǎn)后按行重新存入字符串?dāng)?shù)組XX中,最后調(diào)用函數(shù)WRITEDAT()把結(jié)果XX輸出到文件中.原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于80個(gè)字符,含標(biāo)點(diǎn)符號(hào)和空格.注意:部分源程序已給出。intmaxline=0;/*文章的總行數(shù)*/dvoidChA(void){inti,j;harchfor(i=0;i<maxline;i++){ch=xx[i][0];for(j=0;j<strlen(xx[i])-1;j++)xx[i][j]+=xx[i][j+1];xx[i][strlen(xx[i])-1]+=ch;strrev(xx[i]);}}{printf("數(shù)據(jù)文件不能打開!\n\007");}ChA();}{FILE*fp;inti;iffpfopenr==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){inif(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}*********************************函數(shù)ReadDat()實(shí)現(xiàn)從文件中讀取一篇英文文章,存入到字符串?dāng)?shù)組xx中;請(qǐng)編制函數(shù)encryptChar(),按給定的替代關(guān)系txx部分源程序存在文件中。原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于80個(gè)字符。tintmaxline=0;/*文章的總行數(shù)*/voidencryptChar(){inti,j;for(i=0;i<maxline;i++)for(j=0;j<strlen(xx[i]);j++)if(xx[i][j]*11%256<=32||xx[i][j]%2==0)continue;elsexx[i][j]=xx[i][j]*11%256;}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}*********************************編寫一個(gè)函數(shù)findStr(char*str,char*substr),該函數(shù)統(tǒng)計(jì)一個(gè)長(zhǎng)度為2的子字符串在另一個(gè)字符串中出現(xiàn)的次數(shù)。例如,注意:部分源程序存在文件中。intfindStr(char*str,char*substr){inti,j,len1,len2,cnt=0,flag;len1=strlen(str);lenstrlen(substr);for(i=0;i<len1;i++){for(j=0;j<len2;j++)flag=1;if(str[i+j]==substr[jflag=1;if(flag==1)cnt++;}returncnt;}{tnprintf("輸入原字符串:");printf("輸入子字符串:");}{FILE*rf,*wf;rf=fopen("","r");wf=fopen("","w");while(i<25){fprintf(wf,"%d\n",n);i++;}f}*******************************文件中。intjsValue(intt){intf0=0,f1=1,fn;fn=f0+f1;while(fn<=t){f0=f1;f1=fn;fn=f0+f1;}returnfn;}{}{FILE*in,*out;in=fopen("","r");for(i=0;i<50;i++){n}}*******************************XX5),否則執(zhí)行步驟(2);{floatx0,x1;x1=;ilefabsxxreturnx1;}{}{FILE*wf;wf=fopen("","w");}注:本題在無(wú)憂或捷成模擬盤中,需定義doublex0,x1;才能通過(guò),據(jù)實(shí)際上機(jī)抽到該題的考生反映,實(shí)際上機(jī)需按上面解法的定義方能通過(guò),特此說(shuō)明,供參考。*******************************程序存在文件中。{inti;for(i=1;i<n;i++)if(i%21==0)s+=i;returnsqrt(s);}{}{FILE*fp,*wf;fp=fopen("","r");if(fp==NULL){printf("數(shù)據(jù)文件不存在!");}wf=fopen("","w");for(i=0;i<10;i++){fprintf(wf,"%f\n",s);}}************************已知在文件中存有N個(gè)(個(gè)數(shù)<200)實(shí)數(shù),函數(shù)readdat()讀取這N個(gè)實(shí)數(shù)并存入數(shù)組xx中。請(qǐng)編制函數(shù)calvalue(),其功注意:部分源程序已給出。floatxx[MAXNUM];intN=0;/*文件中共有多少個(gè)實(shí)數(shù)*/dluevoid{inti;for(i=0;i<N;i++){sumint+=(long)xx[i];sumdec+=xx[i]-(long)xx[i];aver+=xx[i];}aver/=N;}{inti;for(i=0;i<MAXNUM;i++)xx[i]=0;printf("數(shù)據(jù)文件不能打開!\007\n");}printf("文件中共有實(shí)數(shù)=%d個(gè)\n",N);printflfn",aver);printf("整數(shù)部分之和=%.2lf\n",sumint);}{FILE*fp;inti;iffpfopenr==NULL)return1;while(!feof(fp)){fscanf(fp,"%d,",&xx[i++]);}}{FILE*fp;fp=fopen("","w");}*******************************下列程序的功能是:在三位整數(shù)(100至999)中尋找符合條件的整數(shù)并依次從小到大存入數(shù)組中;它既是完全平方數(shù),又請(qǐng)編制函數(shù)實(shí)現(xiàn)此功能,滿足該條件的整數(shù)的個(gè)數(shù)通過(guò)所編制的函數(shù)返回。intjsValue(intbb[]){inti,j,k=0;inthun,ten,data;for(i=10;i<32;i++){j=I*I;hum=j/100;ten=j%100/10;data=j%10;tabb[k++]=j;}returnk;}{}b{FILE*out;inti;for(i=0;i<num;i++){printf("%d\n",b[i]);fprintf(out,"%d\n",b[i]);}}***************************注意:部分源程序已給出。aluelongn{inti,strl,half;charxy[20];strl=strlen(xy);half=strl/2;for(i=0;i<half;i++)if(xy[i]!=xy[--strl])break;if(i>=half)return1;}?FILE*out;sValuemjsValuemmjsValuemmmprintfmldmmldmmmldnm,m*m,m*m*m);dnmmmmmm}}}?aluelongn{longints=0,k;k=n;while(k)ss0+k%10;k/=10;}if(s==n)return1;if(s!=n)return0;}?m=11,m*m=121,m*m*m=1331****************************已知在文件中存有若干個(gè)(個(gè)數(shù)<200)四位數(shù)字的正整數(shù),函數(shù)ReadDat()讀取這若干個(gè)正整數(shù)并存入數(shù)組xx中。請(qǐng)編制riteDat文件中。intxx[MAXNUM];inttotNum=0;/*文件中共有多少個(gè)正整數(shù)*/inttotCnt=0;/*符合條件的正整數(shù)的個(gè)數(shù)*/doubletotPjz=;/*平均值*/doid{inti,data;for(i=0;i<MAXNUM;i++)if(xx[i]>0){totNum++;data=xx[i]>>1;if(data%2==0){totCnt++;totPjz+=xx[i];}}if(totCnt==0)totPjz=0;elsetotPjz/=totCnt;}{inti;for(i=0;i<MAXNUM;i++)xx[i]=0;printf("數(shù)據(jù)文件不能打開!\007\n");}printf("文件中共有正整數(shù)=%d個(gè)\n",totNum);printf("符合條件的正整數(shù)的個(gè)數(shù)=%d個(gè)\n",totCnt);printffntotPjz;}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(!feof(fp)){fscanf(fp,"%d,",&xx[i++]);}}{FILE*fp;fp=fopen("","w");}***********************求出千位數(shù)上的數(shù)減百位數(shù)上的數(shù)減十位數(shù)上的數(shù)減個(gè)位數(shù)上的數(shù)大于零的個(gè)數(shù)cnt,再把所有滿足此條件的四位數(shù)依次存文件中。lue{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<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]>b[j]){qw=b[i];b[i]=b[j];b[j]=qw;}}{inti;for(i=0;i<cnt;i++)printf("b[%d]=%d\n",i,b[i]);}{FILE*fp;inti;fp=fopen("","r");forii;i++)fscanf(fp,"%d,",&a[i]);}{FILE*fp;inti;fp=fopen("","w");tffpdncntfor(i=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}***************************ab原四位數(shù)的千位數(shù)字,新十位數(shù)的個(gè)位數(shù)字是原四位數(shù)的十位數(shù)字),以及把個(gè)位數(shù)字和百位數(shù)字組成另一個(gè)新的十位數(shù)cd(新十位數(shù)的十位數(shù)字是原四位數(shù)的個(gè)位同時(shí)兩個(gè)新數(shù)的十位數(shù)字均不為零,則將滿足此條件的四位數(shù)按從大到小的順序存入數(shù)組b中,并要計(jì)算滿足上述條件的tb注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j,thou,hun,ten,data,ab,cd;for(i=0;i<200;i++){thou=a[i]/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)>=0&&(ab-cd)<=10&&ab%2==1&&cd%2==1&&ab>=10&&cd>=10)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]<b[j]){thou=b[i];b[i]=b[j];b[j]=thou;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}****************************)ab位數(shù)字是原四位數(shù)的千位數(shù)字,新十位數(shù)的個(gè)位數(shù)字是原四位數(shù)的十位數(shù)字),以及把個(gè)位數(shù)字和百位數(shù)字組成另一個(gè)新的十位數(shù)cd(新十位數(shù)的十位數(shù)字是原四位數(shù)的個(gè)位同時(shí)兩個(gè)新數(shù)的十位數(shù)字均不為零,則將滿足此條件的四位數(shù)按從大到小的順序存入數(shù)組b中,并要計(jì)算滿足上述條件的注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal()dfor(i=0;i<MAX;i++){qw=a[i]/1000;bw=a[i]/100%10;sw=a[i]%100/10;gw=a[i]%10;ab=qw*10+sw;cd=gw*10+bw;if(ab-cd>=10&&ab-cd<=20&&ab%2==0&&cd%2==0&&qw!=0&&gw!=0)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]<b[j]){qw=b[i];b[i]=b[j];b[j]=qw;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}**************************atb注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j,flag;for(i=0;i<MAX-5;i++){for(j=i+1;j<=i+5;j++)if(a[i]<a[j]&&a[i]%2==0)flag=1;if(flag==1)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]>b[j]){flag=b[i];b[i]=b[j];b[j]=flag;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}*******************************文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+1;j<100;j++)if(sell[i].je<sell[j].je||sell[i].je==sell[j].je&&strcmp(sell[i].dm,sell[j].dm)<0){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<MAX;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<MAX;i++){}}*****************************按金額從小到大進(jìn)行排列,最終排列結(jié)果仍存入結(jié)構(gòu)數(shù)組sell中文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];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)<0||strcmp(sell[i].mc,sell[j].mc)==0&&sell[i].je>sell[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<100;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<100;i++){}}*******************************N2文件中。{inti;FILE*fp;if((fp=fopen("","r"))==NULL)return1;/***編制函數(shù)ReadDat()的部分***/for(i=0;i<MAX;i++){fscanf(fp,"%d,",&xx[i]);if((i+1)%10==0)fscanf(fp,"\n");}/**************************/}Computevoid{inti,yy[MAX];for(i=0;i<MAX;i++)yy[i]=0;for(i=0;i<MAX;i++)if(xx[i]%2==0){yy[even++]=xx[i];ave2+=xx[i];}else{odd++;ave1+=xx[i];}for(i=0;i<even;i++)totfc+=(yy[i]-ave2)*(yy[i]-ave2)/even;}{inti;for(i=0;i<MAX;i++)xx[i]=0;printf("數(shù)據(jù)文件不能打開!\007\n");}fc}{FILE*fp;inti;fp=fopen("","w");}****************************注意:部分源程序存放在文件中。intisPrime(intm){inti;for(i=2;i<m;i++)if(m%i==0)return0;return1;}{inti,j,bw,sw,gw;for(i=100;i<1000;i++){bw=i/100;sw=i%100/10;gw=i%10;if(isPrime(i)&&(gw+sw)%10==bw){cnt++;sum+=i;}}}{printf("素?cái)?shù)的個(gè)數(shù)=%d\n",cnt);printf("滿足條件素?cái)?shù)值的和=%d",sum);writeDAT);}{FILE*fp;fp=fopen("","w");m}******************************intb[3];lueileif(sn<100&&sn+a12>=100)b[0]=k;snabkif(sn<10000&&sn+a12>=10000){b[2]=k;break;}k++;}}{}{FILE*fp;fp=fopen("","w");bb}*******************************p部分源程序存在文件中。原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于80個(gè)字符。tintmaxline=0;/*文章的總行數(shù)*/voidencryptChar(){inti,j;for(i=0;i<maxline;i++)for(j=0;j<strlen(xx[i]);j++)if(xx[i][j]*11%256<=32||xx[i][j]*11%256>='0'&&xx[i][j]*11%256<='9')continue;elsexx[i][j]=xx[i][j]*11%256;}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}****************************p部分源程序存在文件中。原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于80個(gè)字符。tintmaxline=0;/*文章的總行數(shù)*/voidencryptChar(){inti,j;for(i=0;i<maxline;i++)for(j=0;j<strlen(xx[i]);j++)if(xx[i][j]*11%256<=32||xx[i][j]>='A'&&xx[i][j]<='Z')continue;elsexx[i][j]=xx[i][j]*11%256;}{}}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(fgets(xx[i],80,fp)!=NULL){if(p)*p=0;i++;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<maxline;i++){printf("%s\n",xx[i]);fprintf(fp,"%s\n",xx[i]);}}********************************t文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];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)>0||strcmp(sell[i].dm,sell[j].dm)==0&&sell[i].je>sell[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<100;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<100;i++){}}*******************************或文件中。intyy[10];dCountRsvoid{inti,j,count;for(i=0;i<100;i++){count=0;for(j=0;j<10;j++)if(xx[i][j]=='1')count++;for(j=0;j<10;j++)if(xx[i][j]=='1')yy[j]++;}}{inti;for(i=0;i<10;i++)yy[i]=0;}}{FILE*fp;inti;if((fp=fopen("","r"))==NULL)return1;for(i=0;i<100;i++){eturnxx[i][10]='\0';}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<10;i++){fprintf(fp,"%d\n",yy[i]);printf("第%d個(gè)人的選票數(shù)=%d\n",i+1,yy[i]);}}******************************已知在文件中存有若干個(gè)(個(gè)數(shù)<200)四位數(shù)字的正整數(shù),函數(shù)ReadDat()讀取這若干個(gè)正整數(shù)并存入數(shù)組xx中。請(qǐng)編制文件中。intxx[MAXNUM];inttotNum=0;/*文件中共有多少個(gè)正整數(shù)*/inttotCnt=0;/*符合條件的正整數(shù)的個(gè)數(shù)*/doubletotPjz=;/*平均值*/doidfor(i=0;i<MAXNUM;i++)if(xx[i]>0){totNum++;qw=xx[i]/1000;bw=xx[i]/100%10;sw=xx[i]%100/10;gw=xx[i]%10;if((qw+bw+sw+gw)%2==0){totCnt++;totPjz+=xx[i];}}if(totCnt==0)totPjz=0;elsetotPjz/=totCnt;}{inti;for(i=0;i<MAXNUM;i++)xx[i]=0;printf("數(shù)據(jù)文件不能打開!\007\n");}printf("文件中共有正整數(shù)=%d個(gè)\n",totNum);printf("符合條件的正整數(shù)的個(gè)數(shù)=%d個(gè)\n",totCnt);printffntotPjz;}{FILE*fp;ntiif((fp=fopen("","r"))==NULL)return1;while(!feof(fp)){fscanf(fp,"%d,",&xx[i++]);}}{FILE*fp;fp=fopen("","w");}*****************************文件中。for(i=0;i<10;i++)for(x=0;x<10;x++)for(n=1;n<10;n++)sixs*100+i*10+x;if(3*six==2*nine){cnt++;sum+=six+nine;}}}{printf("滿足條件的個(gè)數(shù)=%d\n",cnt);}{FILE*fp;fp=fopen("","w");}*****************************t文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];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)<0||strcmp(sell[i].mc,sell[j].mc)==0&&sell[i].je<sell[j].je){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<100;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<100;i++){}}*****************************無(wú)憂id82題(只是將結(jié)果按“從大到小”排序)sSort函數(shù)的功能是:以行為單位對(duì)字符串變量的下標(biāo)為奇數(shù)的字符按其ASCII值從小到大的順序進(jìn)行排序,排序后的結(jié)果仍按例如:位置01234567源字符串a(chǎn)bcdefgh則處理后字符串a(chǎn)hcfedgb文件中。tvoidjsSort(){inti,j,k,strl;archfor(i=0;i<20;i++){strl=strlen(xx[i]);for(j=1;j<strl-2;j=j+2)for(k=j+2;k<strl;k=k+2)if(xx[i][j]>xx[i][k]){ch=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=ch;}}}{}{FILE*in;in=fopen("","r");while(i<20&&fgets(xx[i],80,in)!=NULL){if(p)*p=0;i++;}}{FILE*out;inti;for(i=0;i<20;i++){printf("%s\n",xx[i]);fprintf(out,"%s\n",xx[i]);}}***************************排序交換題)sSort函數(shù)的功能是:以行為單位對(duì)字符串按給定的條件進(jìn)行排序,排序后的結(jié)果仍按行重新存入字符串?dāng)?shù)組xx中,最后調(diào)用函條件:從字符串中間一分為二,左邊部分按字符的ASCII值降序排序,排序后左邊部分與右邊部分進(jìn)行交換。如果原字符串長(zhǎng)度為奇數(shù),則最中間的字符不參加處理,字符仍放在原位置上。例如:位置012345678源字符串a(chǎn)bcdhgfe123498765則處理后字符串hgfedcba876594321文件中。tvoidjsSort(){inti,j,k,strl,half;chartemp;for(i=0;i<20;i++){strl=strlen(xx[i]);half=strl/2;for(j=0;j<half-1;j++)for(k=j+1;k<half;k++)if(xx[i][j]<xx[i][k]){temp=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=temp;}for(j=half-1,k=strl-1;j>=0;j--,k--){temp=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=temp;}}}{}{FILE*in;in=fopen("","r");while(i<20&&fgets(xx[i],80,in)!=NULL){if(p)*p=0;i++;}}{FILE*out;inti;for(i=0;i<20;i++){printf("%s\n",xx[i]);fprintf(out,"%s\n",xx[i]);}}**************************atb注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j,flag;for(i=5;i<MAX;i++){for(j=i-5;j<i;j++)if(a[i]>a[j]&&a[i]%2==0)flag=1;if(flag==1)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]<b[j]){flag=b[i];b[i]=b[j];b[j]=flag;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}************************** 注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,j,flag;for(i=5;i<MAX;i++){for(j=i-5;j<i;j++)if(a[i]>a[j]&&a[i]%2&&a[i]%7==0)flag=1;if(flag==1)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]<b[j]){flag=b[i];b[i]=b[j];b[j]=flag;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}*******************************文件中。tchardm[5];/*產(chǎn)品代碼*/charmcntdj/*單價(jià)*//*數(shù)量*//*金額*/PROsell[MAX];voidSortDat(){inti,j;PROxy;for(i=0;i<99;i++)for(j=i+1;j<100;j++)if(sell[i].je<sell[j].je||sell[i].je==sell[j].je&&strcmp(sell[i].dm,sell[j].dm)>0){xy=sell[i];sell[i]=sell[j];sell[j]=xy;}}{}{FILE*fp;inti;fp=fopen("","r");for(i=0;i<100;i++){sell[i].je=(long)sell[i].dj*sell[i].sl;}}{FILE*fp;inti;fp=fopen("","w");for(i=0;i<100;i++){}}*****************************求出千位數(shù)上的數(shù)加個(gè)位數(shù)上的數(shù)等于百位數(shù)上的數(shù)加十位數(shù)上的數(shù)的個(gè)數(shù)cnt,再把所有滿足此條件的四位數(shù)依次存入數(shù)在文件中。lueintiqwbwswgwjfor(i=0;i<300;i++){qw=a[i]/1000;bw=a[i]%1000/100;sw=a[i]%100/10;gw=a[i]%10;if(qw+gw==bw+sw)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]>b[j]){qw=b[i];b[i]=b[j];b[j]=qw;}}{inti;for(i=0;i<cnt;i++)printf("b[%d]=%d\n",i,b[i]);}{FILE*fp;inti;fp=fopen("","r");forii;i++)fscanf(fp,"%d,",&a[i]);}{FILE*fp;inti;fp=fopen("","w");tffpdncntfor(i=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}********************************文件中。luefor(i=0;i<300;i++){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==0)pjz1=0;if(n==0)pjz2=0;}{inti;}{FILE*fp;inti;fp=fopen("","r");forii;i++)fscanf(fp,"%d,",&a[i]);}{FILE*fp;inti;fp=fopen("","w");}**********************************,排序后的結(jié)果仍按行重新存入字符串?dāng)?shù)組xx中,最后調(diào)用函條件:從字符串中間一分為二,左邊部分按字符的ASCII值升序排序,排序后左邊部分與右邊部分進(jìn)行交換。如果原字符串長(zhǎng)度為奇數(shù),則最中間的字符不參加處理,字符仍放在原位置上。例如:位置012345678源字符串dcbahgfe432198765則處理后字符串hgfeabcd876591234文件中。voidjsSort(){inti,j,k,strl,half;chartemp;for(i=0;i<20;i++){strl=strlen(xx[i]);half=strl/2;for(j=0;j<half-1;j++)for(k=j+1;k<half;k++)if(xx[i][j]>xx[i][k]){temp=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=temp;}for(j=half-1,k=strl-1;j>=0;j--,k--){temp=xx[i][j];xx[i][j]=xx[i][k];xx[i][k]=temp;}}}{}{FILE*in;in=fopen("","r");while(i<20&&fgets(xx[i],80,in)!=NULL){if(p)*p=0;i++;}}{FILE*out;inti;for(i=0;i<20;i++){printf("%s\n",xx[i]);fprintf(out,"%s\n",xx[i]);}}****************************是:把千位數(shù)字和十位數(shù)字重新組成一個(gè)新的十位數(shù)(新十位數(shù)的十位數(shù)字是原四位數(shù)的千位數(shù)字,新十位數(shù)的個(gè)位數(shù)字是原四位數(shù)的十位數(shù)字),以及把個(gè)位數(shù)字和百位數(shù)字組成另一個(gè)新的十位數(shù)(新十位數(shù)的十位數(shù)字是原四位數(shù)的個(gè)位數(shù)字,新十位數(shù)的個(gè)位數(shù)字是原四位數(shù)的百位數(shù)字),如果新組成的兩個(gè)十位數(shù)均是素?cái)?shù)且新數(shù)的十位數(shù)字均不為零,則將滿足此writeDatcntb位數(shù)輸出到文件中。注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;{inti;for(i=2;i<=m/2;i++)}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]%10;ab=10*qw+sw;cd=10*gw+bw;if(isprime(ab)&&isprime(cd)&&ab>=10&&cd>=10)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]<b[j]){qw=b[i];b[i]=b[j];b[j]=qw;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;inti;fp=fopen("","w");intffpdncntfori=0;i<cnt;i++)fprintf(fp,"%d\n",b[i]);}****************************是:把千位數(shù)字和個(gè)位數(shù)字重新組成一個(gè)新的十位數(shù)(新十位數(shù)的十位數(shù)字是原四位數(shù)的千位數(shù)字,新十位數(shù)的個(gè)位數(shù)字是原四位數(shù)的個(gè)位數(shù)字),以及把百位數(shù)字和十位數(shù)字組成另一個(gè)新的十位數(shù)(新十位數(shù)的十位數(shù)字是原四位數(shù)的百位數(shù)字,新十位數(shù)的個(gè)位數(shù)字是原四位數(shù)的十位數(shù)字),如果新組成的兩個(gè)十位數(shù)均是奇數(shù)并且兩個(gè)十位數(shù)中至少有一個(gè)數(shù)能被5整除,同時(shí)兩個(gè)新數(shù)的十位數(shù)字均不為零,則將滿足此條件的四位數(shù)按從大到小的順序存入數(shù)組b中,并要計(jì)算滿足上述條注意:部分源程序存在文件中。#defineMAX200inta[MAX],b[MAX],cnt=0;voidjsVal(){inti,thou,hun,ten,data,j;intab,cd;for(i=0;i<MAX;i++){thou=a[i]/1000;hun=a[i]%1000/100;ten=a[i]%100/10;data=a[i]%10;ab=10*thou+data;cd=10*hun+ten;if(ab%2&&cd%2&&(ab%5==0||cd%5==0)&&ab>=10&&cd>=10)b[cnt++]=a[i];}for(i=0;i<cnt-1;i++)for(j=i+1;j<cnt;j++)if(b[i]<b[j]){data=b[i];b[i]=b[j];b[j]=data;}}{inti;FILE*fp;fp=fopen("","r");for(i=0;i<MAX;i++)fscanf(fp,"%d",&a[i]);}{inti;jsVal();printf("滿足條件的數(shù)=%d\n",cnt);for(i=0;i<cnt;i++)printf("%d",b[i]);printf("\n");}{FILE*fp;i

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論