搜索
您的当前位置:首页正文

2013三级网络技术考试重点题型

来源:六九路网
1.选票{int i,j,cnt; for(i=0;i<100;i++) {cnt=0;

for(j=0;j<10;j++)

if(xx[i][j]=='1')

cnt++; if(cnt>5) {for(j=0;j<10;j++) if(xx[i][j]=='1') yy[j]++;} }

2.出圈

{ int i,j,temp; for(i=0;ifor(i=n;i>=2;i--) {s=(s+m-1)%i; temp=p[s]; for(j=s;jp[i-1]=temp; } 3.结构体{int i,j; PRO temp; for(i=0;iif(strcmp(sell[i].mc,sell[j].mc)>0 ||strcmp(sell[i].mc,sell[j].mc)==0&&sell[i].je>sell[j].je)

{ temp=sell[i]; sell[i]=sell[j]; sell[j]=temp;}

4.数位分解{int i,j; int a1,a2,a3,a4; int temp;

for(i=0;i<300;i++)

{a1=a[i]%10; a2=a[i]%100/10; a3=a[i]%1000/100; a4=a[i]/1000;

if(a4+a1==a3+a2) b[cnt++]=a[i]; }

for(i=0;iif(b[i]>b[j])

{ temp=b[i]; b[i]=b[j]; b[j]=temp;}

5.相邻数大小排序{int i,j; {int temp;

for(i=0;iif(a[i]%2==0&&a[i]&&a[i]b[cnt++]=a[i];

for(i=0;ib[j]) {temp=b[i]; b[i]=b[j];

b[j]=temp};} }

6.按数组排序{int i,j; Data temp; int cnt=0;

for(i=0;i<200;i++)

if(aa[i].x2>aa[i].x1+aa[i].x3) bb[cnt++]=aa[i]; for(i=0;iif(bb[i].x2+bb[i].x3return cnt;} 7.迭代1.{float x0,x1=0.0; while(1) {x0=x1;

x1=(float)cos(x0); if(fabs(x0-x1)<1e-6) break;}

return x1; }

迭代 2.{ int f1=0,f2=1,fn; fn=f1+f2;

while(fn<=t) { f1=f2; f2=fn; fn=f1+f2;}

if(fn-t迭代3.{ int n=2; int a1=1,a2=1,an; int sum;

sum=a1+a2; do

{an=a1+a2*2;

if(sum<100&&sum+an>=100) b[0]=n;

if(sum<1000&&sum+an>=1000) b[1]=n;

if(sum<10000&&sum+an>=10000) b[2]=n; a1=a2; a2=an; sum+=an; n++;}

while(sum<10000);}

8.计算素数{int i,j,half; for(i=800;i>500;i--) { half=i/2; for(j=2;jif(j>=half) cnt++;}

9.字符替代{ int i,j,val; for(i=0;i{ val=xx[i][j]*11%256;

if(xx[i][j]>='a'&&xx[i][j]<='z'||val<=32) continue;

else xx[i][j]=val;}

}

10.字符移动 1.{ int I;char temp;

unsigned int j;

for(i=0;i{ temp=xx[i][0]; /* 字符替代 */

for(j=0;jxx[i][j]+=xx[i][j+1]; xx[i][strlen(xx[i])-1]+=temp;

strrev(xx[i]); /* 字符串翻转 */

}

}2. {int i; char temp;

temp=*s; for(i=0;i*(s+strlen(s)-1)=temp; }

11.遍历统计、移动或倒排

{int i,cnt=0; for(i=0;i<80;i++) if(*(str+i)==*substr&&*(str+i+1)==*(substr+1)) cnt++;

return cnt;}

12.平均值及方差 { int i; for(i=0;iave1+=xx[i]; } else ave2+=xx[i];} ave1/=odd; ave2/=(MAX-odd);

for(i=0;itotfc+=(xx[i]-ave1)*(xx[i]-ave1)/odd;} 13、统计个数及平均值

{ int i; for(i=0;i0) {totNum++;

if((xx[i]>>1)%2==0)

{totCnt++;

totPjz+=xx[i];}

}

totPjz/=totCnt; }

14.数位分解与重{inti,j;int a1,a2,a3,a4;

int ab,cd;

int temp;

for(i=0;i{ a1=a[i]%10;

a2=a[i]%100/10; a3=a[i]%1000/100;

a4=a[i]/1000;

ab=a4*10+a2;

cd=a1*10+a3;

if(ab-cd>=0&&ab-cd<=10&&ab%2==1&&cd%2==1 &&a4!=0&&a1!=0) b[cnt++]=a[i]; }

for(i=0;i{temp=b[i]; b[i]=b[j]; b[j]=temp;} }

因篇幅问题不能全部显示,请点此查看更多更全内容

Top