2001年(下)高級語言程序設(shè)計(一)試卷答案

字號:

高級語言程序設(shè)計 (一) 試題 參考答案
    一、單項選擇題
    1. D
    2. C
    3. A
    4. B
    5. C
    6. B
    7. A
    8. D
    9. B
    10. D
    11. D
    12. B
    13. A
    14. C
    15. D
    16. D
    17. C
    18. A
    19. A
    20. B
    二、填空題
    21. Double a = 0.618;
    22. 1
    23. x>20&&x< = 30或者(x>20) && (x< = 30)
    24. 2
    25. 0
    26. 靜態(tài)存儲,或者static
    27. P - > no = 1234;或者( * p) .no = 1234;
    28. 字節(jié)
    29. 16
    30. a[1][0]
    三、程序分析題
    31. 201,21
    202,22
    203,23
    204,24
    205,25
    32. Q
    33. 7 6 5 4 3 2 1
    34. Li ning:19
    Lang ping:21
    Zhu jian hua:20
    35. 2,65,A
    四、程序填充題
    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) <
    五、程序設(shè)計題
    下述答案僅供參考,若采用其它方法答案,只要正確實現(xiàn)題目要求即可。
    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;iif(str[i]! = str[n - 1 -i])
    {printf(″No! \ n″);break;}
    if(i = = n/2) printf(″Yes! \ n″);