2010年9月计算机二级C语言笔试真题及答案(国外英文资料).doc
文本预览下载声明
2010年9月计算机二级C语言笔试真题及答案(国外英文资料)
. .
............”
一个..................
....................
C ..............................
..........................
18 ............ . .
# include stdio . h
主要....
{ int x;
scanf . .“% d”,x . .;
如果. . x = 3 . .其他;
如果. . x ! = 10 . .
printf . .“% d \ n”,x . .;
}
............................................
一个........十……
........ . . ........十……
C……………十……
........…………
19 ............ . .
# include stdio . h
主要....
{
int a = 1,b = 2,c = 3,d = 0;
如果. .a = 1 b + = 2 . .
如果b . . !c = 2 | | - != 3 . .
printf…”% d % d % d \ n”,a,b,c . .;
其他printf…”% d % d % d \ n”,a,b,c . .;
其他printf…”% d % d % d \ n”,a,b,c . .;
}
......................
. . 1、2、3
.... 1、3、2
.... 1,3,3
.... 3、2、1
20 ............................ . .
. .我= 0;我 4,我+ + + +
. . k = 1;k 3;k + + . .,printf…“*”…;
..................
. * * * * * * * *
.... * * * *
.... * *
.... *
21 ............ . .
# include stdio . h
主要....
{ char
ABC . . * s = . .”;
做
{ printf . .“% d * s % 10 . .;s + +;
} . . * s . .;
}
..........……ASCII……65年........................
.... 5670
.... 656667
.... 567
.... ABC
22 .............................................................................. . .
.... n = 0;.... ch =获取字符……! = \ n . . n + +;
....n = 0;. .获取字符.... ! = \ n . . n + +;
....为. .n = 0;获取字符.... ! = \ n ;n + + . .;
.... n = 0;. . ch =获取字符....;ch ! = \ n ;n + + . .;
23 ............ . .
# include stdio . h
主要....
{ int a1,a2,char c1,c2;
scanf…”% d % c % d % c”,a1,a2,c1,c2…;
printf…”% d % c % d % c”,a1,a2,c1,c2…;
}
......................a1……12日,a2……34 . .c1 ..........一个c2 ..........b,....
............ 12日,34 b .................................... CR ..........
. 12 a34b CR
.... 12……34 b . . CR
C . . 12日,34 b CR
.... 12…a34…b CR
24 ............ . .
# include stdio . h
int f . . int x,int y . .
{返回. . x . . * x . .;}
主要....
{ int = 3,b = 4,c = 5,d;
d = f…a,b . . f . . a,c ....;
printf . .“% d \ n”,d . .;
}
......................
10 . .
.... 9
.... 8
.... 7
25 ............
显示全部