三级网络答案jsSort

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

三级网络答案jsSortintjsSort(){inti,j,c=0;Datat;for(i=0;iif(aa[i].x2aa[i].x1+aa[i].x3){bb[c++]=aa[i];}for(i=0;ifor(j=i+1;jif(bb[i].x2+bb[i].x3{t=bb[i];bb[i]=bb[j];bb[j]=t;}returnc;}voidjsVal(){inti,j,t;intgw,sw,bw,qw;for(i=0;i{gw=a[i]%10;sw=a[i]/10%10;bw=a[i]/100%10;qw=a[i]/1000;if(gw%2==0&&sw%2==0&&bw%2==0&&qw%2==0)b[cnt++]=a[i];}for(i=0;ifor(j=i+1;jif(b[i]}voidSortCharA(void){intk,i,j;chart;for(k=0;kxx[k][j]){t=xx[k][i];xx[k][i]=xx[k][j];xx[k][j]=t;}}voidcountValue(int*a,int*n){inti,j=0;for(i=1;i{if(i%7==0&&i%11!=0||i%7!=0&&i%11==0)a[j++]=i;}*n=j;}voidjsVal(){inti;intab,cd,j,t;for(i=0;i{ab=a[i]/1000*10+a[i]/10%10;cd=a[i]%10*10+a[i]/100%10;if(ab}for(i=0;ifor(j=i+1;jif(b[i]{t=b[i];b[i]=b[j];b[j]=t;}}voidCalValue(void){inti,gw,sw,bw,qw;for(i=0;xx[i]!=0;i++){gw=xx[i]%10;sw=xx[i]/10%10;bw=xx[i]/100%10;qw=xx[i]/1000;if((gw+sw+bw+qw)%2==0){totPjz=totPjz+xx[i];totCnt++;}}totNum=i;totPjz=totPjz/totCnt;}voidjsVal(){inti,j,ab,cd,t;for(i=0;i{ab=a[i]/1000*10+a[i]/10%10;cd=a[i]%10*10+a[i]/100%10;if(ab-cd=10&&ab-cdb[cnt++]=a[i];}}for(i=0;ifor(j=i+1;jif(b[i]{t=b[i];b[i]=b[j];b[j]=t;}}voidjsSort(){intlend,rstart,len;intk,i,j;chart;for(k=0;k{len=strlen(xx[k]);lend=len/2;rstart=(len+1)/2;for(i=0;ifor(j=i+1;jif(xx[k][i]{t=xx[k][i];xx[k][i]=xx[k][j];xx[k][j]=t;}for(i=rstart;ifor(j=i+1;jif(xx[k][i]xx[k][j]){t=xx[k][i];xx[k][i]=xx[k][j];xx[k][j]=t;}}}voidjsVal(){inti,j,ab,cd,t;for(i=0;i{ab=a[i]%10*10+a[i]/1000;cd=a[i]/100%10*10+a[i]/10%10;if((ab%2==1&&cd%2==0||ab%2==0&&cd%2==1)&&(ab%17==0||cd%17==0)&&ab=10&&cd=10){b[cnt++]=a[i];}}for(i=0;i=10&&cd=10){b[cnt++]=a[i];}}for(i=0;ifor(j=i+1;j{if(b[i]{t=b[i];b[i]=b[j];b[j]=t;}}}voidSortDat(){inti,j;PROt;for(i=0;ifor(j=i+1;j{if(sell[i].jesell[j].je){t=sell[i];sell[i]=sell[j];sell[j]=t;}elseif(sell[i].je==sell[j].je&&strcmp(sell[i].dm,sell[j].dm)0){t=sell[i];sell[i]=sell[j];sell[j]=t;}}}jsValue(){inti,j;intgw,sw,bw,qw,t;for(i=0;i{gw=a[i]%10;sw=a[i]/10%10;bw=a[i]/100%10;qw=a[i]/1000;if(x+y==z+p)b[cnt++]=a[i];}for(i=0;ifor(j=i+1;jif(b[i]{t=b[i];b[i]=b[j];b[j]=t;}}intjsSort(){inti,j,c=0;Datat;for(i=0;i{if(aa[i].x1aa[i].x2+aa[i].x3)bb[c++]=aa[i];}for(i=0;ifor(j=i+1;jif(bb[i].x1+bb[i].x3bb[j].x1+bb[j].x3){t=bb[i];bb[i]=bb[j];bb[j]=t;}}voidCountRs(void){/*每一条记录的选票情况已作为字符串存入xx[i]为起始地址的存储单元内*//*例如:第10条记录的第一个候选人的选中情况的条件是if(xx[9][0]=='1')*//*该提示仅供解题参考,考生也可用其他方法解题*/inti,j,k;chart;for(i=0;i{k=0;for(j=0;j{if(xx[i][j]=='1')k++;}if(k5)continue;for(j=0;j{if(xx[i][j]=='1')yy[j]++;}}}jsValue(){inti,gw,sw,bw,qw;for(i=0;i{gw=a[i]%10;sw=a[i]/10%10;bw=a[i]/100%10;qw=a[i]/1000;if(gw-qw-bw-sw0){cnt++;pjz1=pjz1+a[i];}else{pjz2=pjz2+a[i];}}pjz1=pjz1/cnt;pjz2=pjz2/(300-cnt);}voidCompute(void){inti;for(i=0;i{if(xx[i]%2==0)even++;elseodd++;aver=aver+xx[i];}aver=aver/MAX;for(i=0;i{totfc=totfc+(aver-xx[i])*(aver-xx[i]);}totfc=totfc/MAX;}voidjsSort(){/*第i行文章的内容已作为字符串存入xx[i]为起始地址的存储单元内*//*提示:先对字符串左边部分的字符数组进行升序排序,左边部分字符数组对应的下标从0到strlen(xx[i])/2。*//*该提示仅供解题参考,考生也可用其他方法解题*/intk,i,j;intlend,rstart,len;chart;for(k=0;k{len=strlen(xx[k]);lend=len/2;rstart=(len+1)/2;for(i=0;ifor(j=i+1;jif(xx[k][i]xx[k][j]){t=xx[k][i];xx[k][i]=xx[k][j];xx[k][j]=t;}for(i=0,j=rstart;i{t=xx[k][i];xx[k][i]=xx[k][j];xx[k][j]=t;}}}voidjsValue(){inti,qw,bw,sw,gw;for(i=0;i{gw=a[i]%10;sw=a[i]/10%10;bw=a[i]/100%10;qw=a[i]/1000;if(qw+gw==bw+sw){cnt++;pjz1=pjz1+a[i];}else{pjz2=pjz2+a[i];}}pjz1=pjz1/cnt;pjz2=pjz2/(300-cnt);}voidencryptChar(){/*第i行文章的内容已作为字符串存入xx[i]为起始地址的存储单元内*//*请使用中间变量来存放替代关系处理后的值val*//*例如:val=(xx[i][j]*11)%256;*//*该提示仅供解题参考,考生也可用其他方法解题*/unsignedintval;inti,j;for(i=0;ifor(j=0;j{val=(xx[i][j]*11)%256;if(!(val{xx[i][j]=val;}}}voidjsSort(){inti,j,t;for(i=0;ifor(j=i+1;j{if(aa[i]%1000aa[j]%1000){t=aa[i];aa[i]=aa[j];aa[j]=t;}elseif(aa[i]%1000==aa[j]%1000&&aa[i]{t=aa[i];aa[i]=aa[j];aa[j]=t;}}for(i=0;i{bb[i]=aa[i];}}voidCharConvA(void){inti,j,len;chart;for(i=0;i{len=strlen(xx[i]);t=xx[i][len-1];for(j=len-1;j0;j--){xx[i][j]=(xx[i][j]4)+xx[i][j-1];}xx[i][0]=xx[i][0]+t;}}intjsValue(intt){inta,b,c;a=1;b=1;c=a+b;while(c{a=b;b=c;c=a+b;}returnc;}voidjsValue(){inti,j;intgw,sw,bw,qw,t;for(i=0;i{gw=a[i]%10;sw=a[i]/10%10;bw=a[i]/100%10;qw=a[i]/1000;if(qw-bw-sw-gw0){b[cnt++]=a[i];}}for(i=0;ifor(j=i+1;jif(b[i]b[j]){t=b[i];b[i]=b[j];b[j]=t;}}voidCalValue(void){inti;for(i=0;xx[i]0;i++){aver=aver+xx[i];sumint=sumint+(int)xx[i];sumdec=sumdec+(xx[i]-(int)xx[i]);}N=i;aver=aver/N;}voidCountRs(void){/*每一条记录的选票情况已作为字符串存入xx[i]为起始地址的存储单元内*//*例如:第10条记录的第一个候选人的选中情况的条件是if(xx[9][0]=='1')*//*该提示仅供解题参考,考生也可用其他方法解题*/inti,j,k;chart;for(i=0;i{k=0;for(j=0;j{if(xx[i][j]=='1')k++;}if(kcontinue;for(j=0;j{if(xx[i][j]=='1')yy[j]++;}}}voidcountValue(){inti;for(i=2;i{if(isPrime(i)&&isPrime(i+4)&&isPrime(i+10)){cnt++;sum=sum+i;}}}voidCompute(void){inti,k=0;for(i=0;i{if(xx[i]%2==0){even++;ave2=ave2+xx[i];}else{k++;ave1=ave1+xx[i];}}ave2=ave2/even;ave1=ave1/k;//或者ave1=ave1/(1000-even);for(i=0;i{if(xx[i]%2==0){totfc=totfc+(xx[i]-ave2)*(xx[i]-ave2);}}totfc=totfc/even;}voidjsValue(){inti;for(i=0;i{if(xx[i]%2==1)cnt1++;elsecnt2++;if(i%2==0)pj=pj+xx[i];}pj=pj/100;}voidjsVal(){inti,j

1 / 50
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功