二级c语言上机专用题库答案Word文档下载推荐.doc
《二级c语言上机专用题库答案Word文档下载推荐.doc》由会员分享,可在线阅读,更多相关《二级c语言上机专用题库答案Word文档下载推荐.doc(5页珍藏版)》请在冰豆网上搜索。
![二级c语言上机专用题库答案Word文档下载推荐.doc](https://file1.bdocx.com/fileroot1/2022-10/7/7eb4ce73-077d-48b3-82a5-854f05a9e645/7eb4ce73-077d-48b3-82a5-854f05a9e6451.gif)
(1)999
(2)t/10(3)x
9、___1___;
(1)sum=0
(2)t[i][i](3)1
10、___1___fun(charch)
(1)char
(2)ch<
='
9'
(3)'
0'
11、s=0;
i=__1__;
(1)0
(2)i++(3)2.*i
12、while(!
feof(__1__))
(1)fp
(2)==(3)fp
13、for(i=0;
i<
__1__;
i++)
(1)N
(2)substr(3)0
14、for(p=1;
p<
=__1__;
p++)
(1)k
(2)N-1(3)temp
15.t=(a>
b)?
(b>
c?
b:
(a>
c:
___1___)):
((a>
c)?
___2___:
((b>
___3___));
(1)a
(2)a(3)b
16if((ch>
a'
)___1___(ch<
z'
))
(1)&
&
(2)'
A'
(3)ch
17、if(isdigit(*s))sum+=*s-__1__;
(1)48
(2)s++(3)sum
18、f=___1___;
(1)1
(2)-1(3)t
19、if(n>
=len)strcpy(__1__);
(1)t,s
(2)s[i](3)0
20、__1__fun(structstudent*a)
(1)structstudent*
(2)a->
score[i](3)a
21、max=min=___1___;
(1)a[i]
(2)a[j](3)a[j]
22、voidfun(int___1___,intn)
(1)t[][N]
(2)i=0;
i<
n(3)s
23、voidfun(int___1___,intn)
(1)*a
(2)2(3)i+1
24、f=1.0+___1___;
(1)x
(2)n(3)t
25、t=___1___;
(注意和第1题不一样)
for(i=___2___;
n;
(1)1
(2)1(3)i
26、b__1__=10004;
(1)->
sno
(2)->
name(3)&
t
27、k=__1__;
(注意和第49题不一样)
t=__2__;
(1)1
(2)2*i(3)(-1)
28、s=__1__;
(1)0
(2)n(3)(t*t)
29、ch=tolower(__1__);
(1)*s
(2)1(3)k[n]
30、__1__t;
(1)structstudent
(2)n-1
(3)a[i].name,a[j].name
31、if(___1___==0){
(1)a[i]%2
(2)a[j](3)j
32、{t=*n%__1__;
(1)10
(2)0(3)x
33、for(i=0;
i++)(注意有相类似的)
if(len<
=__2__)
(1)N
(2)k(3)ss[i]
34、__1__;
flag=1;
}
(1)n++
(2)0(3)s++
35、t[j]=__1__;
j++;
(1)s[i]
(2)k(3)0
36、for(i=0;
if(strcmp(ss[i],t)==0)
return__2__;
(注意有类似的)
(1)N
(2)i(3)-1
37、lp=__1__;
(1)s
(2)--(注意是2个减号)
(3)return0
38、x=__1__/4;
(1)3.(注意要打上点)
(2)>
(3)(2*i+1)
39、for(i=0;
___1___;
a[i]=a[n-1-___2___];
(注意有类似题)
(1)n/2
(2)i(3)a[n-i-1]
40、b=__1__;
(1)a
(2)b.name(3)score[i]
41、for(___1___;
j<
i;
j++)
(1)j=2
(2)i(3)j
42、i=__1__;
(1)1
(2)s(3)i*10
43、__1__fun(structstudenta)
(1)structstudent
(2)a.name
(3)a.score[i]
44、p=(n%2==0)?
n/2:
n/2+___1___;
(1)1
(2)i(3)a[p+i]
45、if(a[i]%2==___1___)
(1)1
(2)j++(3)j
46、n=__1__;
(1)0
(2)x(3)t++
47、*(t+n)=__1__;
n++;
}
(1)*s
(2)s++(3)n
48、#defineOK(i,t,n)
((___1___%t==0)&
(i/t<
n))
(1)i
(2)t++(3)count
49、k=__1__;
if(strlen(ps[k])<
strlen(__2__))k=j;
(1)i
(2)ps[j](3)tp
50for(j=a[i]*2;
=n;
j+=___1___)
(1)a[i]
(2)a[i](3)0
二、改错题
1.
(1)for(i=1;
=y;
i++)
(2)t=t%1000;
2.
(1)if(t==0)
(2)*zero=count;
3.
(1)*t=0;
(2)if(d%2!
=0)
4.
(1)for(i=2;
=m;
i++)
(2)y-=1.0/i/i;
5.
(1)t=1;
(2)return(2*s);
6.
(1)#defineFU(m,n)((m)/(n))
(2)return(value);
7.
(1)for(i=strlen(t)-1;
i;
i--)
(2)if(t[j]>
t[j+1])
8.
(1)voidfun(longs,long*t)
(2)while(s>
0)
9.
(1)doubler;
(2)while(fabs(m-n)>
0.001)
10.
(1)b[k]=*p;
(2)b[k]='
'
;
k++;
11.
(1)voidfun(char*s,char*t)
(2)t[2*d]=0;
12.
(1)n=strlen(aa);
(2)ch=aa[i];
13.
(1)fun(intx,inty,intz)
(2)returnj;
14.
(1)voidfun(inta[][M],intm)
(2)a[j][k]=(k+1)*(j+1);
15.
(1)c=tolower(c)(注:
c小写);
(2)c=c+5;
16.
(1)voidfun(int*a)
(2)a[j]=a[j-1];
17.
(1)if((k%13==0)||(k%17==0))(注:
双等号)
(2)}(注:
横线去掉)
18.
(1)for(i=1;
=3;
i++)
(2)if(k>
=0&
k<
=6)
19.
(1)if(i%k==0)
=i)
20.
(1)char*fun(char(*sq)[M])
(2)returnsp;
21.
(1)switch(g)
(2)case1:
return1;
case2:
return1;
22.
(1)fun(inta[],intm)
(2)elseif(m>
a[mid])
23.
(1)sum=0;
(2)if((i+1)%5==0)
24.
(1)d=1;
s=0;
(2)d=d/10;
25.
(1)k=i;
(2)c=k;
26.
(1)doublefun(doublea,doublex0)
(2)if(fabs(x1-x0)>
0.00001)
27.
(1)k++;
(2)if(m==k)
28.
(1)for(i=0;
str[i];
(2)if(substr[k+1]==0)
29.
(1)floatfun(intk)
(2)returns;
30.
(1)q=p+i;
(2)while(q>
p)
31.
(1)fun(intn)
(2)if(n==1)
32.
(1)if(n==0)
(2)result*=n--;
33.
(1)intk=0;
(2)while(*p||*q)
34.
(1)t+=s[k];
(2)*aver=ave;
35.
(1)while(*w)
(2)if(*r==*p)
36.
(1)a2=k/10;
(注意是十)
(2)returni;
37.
(1)doublefun(intn)
(2)c=a;
a+=b;
b=c;
38.
(1)doublefun(intn)
(2)s=s+(double)a/b;
39.
(1)n=*p-'
(2)n=n*8+*p-'
40.
(1)s[j++]=s[i];
(2