您的位置: 首页 计算机类> 水平考试> 历年真题> 软件设计师
计算机软件水平考试软件设计师真题
公务员考试辅导课程

2001年(下)高级语言程序设计(一)试卷答案

发布时间:06-20

来 源:

页 数:2页

上一篇:2004年上半年软件设计师上午试题

下一篇:2001年(下)高级语言程序设计(一)试卷


四、程序填充题
36. (1) j = i + 1
(2) >
(3) b [i] = b [j]
37. (1) digit = 0, blank = 0, other = 0
(2) c> =′0′&&c< = ′9′
(3) ++ other或者other ++
38. (1) &a[i] 或者a + i
(2) x = = a[i]
(3) <

五、程序设计题
下述答案仅供参考,若采用其它方法答案,只要正确实现题目要求即可。
39. main ()
{int i
for(i = 10;i< = 1000;i ++ )
if((i??2 = = 0)&&(i??3 = = 0)&&(i??7 = = 0))
printf(″i = ??d \ n″,i);
}
40. main ()
{int a = 0, b = 0, i;
for(i = 2;i< = 100;i + = 2)
{ 2 + = i;b + = i - 1;}
printf(″Sum of even number = ??d \ n″,a);
printf(″Sum of odd number = ??d \ n″,b);
}
41. # include″string.h″
main ()
{int i, n;static char str[80];
gets(str);n = strlen(str);
for(i = 0;i<n/2;i ++ )
if(str[i]! = str[n - 1 -i])
{printf(″No! \ n″);break;}
if(i = = n/2) printf(″Yes! \ n″);





Google
 

     

考试信息

热点

课程

更新

©2005-2006 100ksw.com 版权所有 皖ICP备06013378号