模拟试题(一)参考答案 一、单项选择题 1. B 2. C 3. A 4. B 5. D 6. B 7. C 8. D 9. A 10. D 11. A 12. B 13. B
14. C 15. A 16. D 17. D 18. A 19. B 20. B
二、填空题 21. 整型
22. 65535 23. 0 24. 2,1
25. void
26. 静态存储,或者static 27. P - > no = 1234;或者( * p) .no = 1234; 28. 字节
29. 16 30. a[1][0] 三、程序分析题 31. 201,21
202,22 203,23
204,24
205,25 32. N 33. 7 6 5 4 3 2 1
34. 100
30,50 35. computer 四、程序填充题 36. (1) &n (2) n%2 (3) n/2 37. (1)[2][5] (2) &ab.a[i] (3) ab.b[i][j] 38. (1) &a[i] 或者a + i (2) x = = a[i] (3) < 五、程序设计题 下述答案仅供参考,若采用其它方法答案,只要正确实现题目要求即可。 39.main()
{
int i=1;
while(i<100)
{
if(i%10==6 && i%3==0)
printf(”%5d”,i);
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″); }
|