文档详情

2008年秋浙江省计算机等级考试(C语言)(国外英文资料).doc

发布:2017-06-05约7.05千字共17页下载文档
文本预览下载声明
2008年秋浙江省计算机等级考试(C语言)(国外英文资料) Computer level examination (C), zhejiang province, 2008 Question 1 (3 points, 12 points) Read the following instructions and procedures, and select the correct answer in each of the optional answers provided in each question. [program description] Enter a batch of students grades, and the negative Numbers will be the end of the input, the number of students who are required to count and output grades. Grades are divided into three grades, A (90 ~ 100), P (60 ~ 89) and F (0 ~ 59). Run the sample: Enter scores: 88, 71, 68, 70, 59, 81, 81, 81, 83, 10 A: 1; P: 8; F: 2; 【 application 】 # include stdio, h The main () {int mark, a, p, f; A = p = f = 0; Printf ( Enter scores: ); Scanf ( % d , mark); While ((1)) If (mark = 90) a + +; (2) p + +; (3) f + +; (4) } Printf ( A: % d; P = % d; f: % d; \ n , A, P, f); } The answer to that choice. (1) A, mark = 0 B, mark 0 C, mark = 0 D, mark 0 (2) A, else if (mark = 60) B, if (mark = 60) C, else (mark = 60) D, if (mark 90) (3) A, else (mark 60) B, else C, if (mark ) D, else if (mark = 60) (4) A, scanf ( % d , mark); B, scanf ( % d , mark); C,; D, mark = getchar (); Question 2 (3 points, 12 points) Read the following instructions and procedures, and select the correct answer in each of the optional answers provided in each question. [program description] I want to find all the cubes that satisfy all of the Numbers between 1 and 999, which is equal to the number of them. For example, the number of the digits of 153 is 13 + 53 + 33 = 153. Running the example: 1, 153, 370, 371, 407 【 application 】 # include stdio, h The main () {int digit, j, sum, x; For (j = 1; j 1000; j + +) {. (5) (6) Do { (7) Sum = sum + digit digit * * digit; X = x / 10; (8) If (sum = = j) printf ( % d ); } } The answer to that choice. (5) A, sum = 0; B, sum = 1; C, the sum = j; D,; (6) A, x = 1; B, x = j; C,; D, x = sum; (7) A, digit = x / 10; B,; C, digit = x % 10; D, digit = x; (8) A, x = 0, B, j! = 0 C, j = = 0; D
显示全部
相似文档