第1 章 习题参考答案 1. (略) 2 判断题 1 2 3 4 5 √ × √ × √ 3 填空题 (1) main (2) 函数的首部、函数体 (3) {、} (4) main、main (5) 语句、分号(;) 4 选择题 1 2 3 4 5 C C C A B 5 选择题 (1) #include main() { int a, b, s; float t; printf("Enter A,B=?\n"); scanf("%d%d", &a, &b); s=a+b; t=a*b; printf("s=%d, t=%f\n", s, t); } (2) #include main() { printf("=================\n"); printf(" Hello! \n"); printf(" How do you do \n"); printf("=================\n"); } (3) #include main() { int r, h; float v; printf("Enter R, H=?\n"); scanf("%d%d", &r, &h); v=3.1415926*r*r*h; printf("v=%f\n",v); } 第2 章 习题参考答案 一.(略) 二.填空题 (1) abedcbba2 (2) 2.5 (3) 16 (4) 10 (5) 16、16、11 (6) 4、10、6 (7) 18、3、3 (8) sin(65*3.14/180)+2*(3.1415926 +exp(y))/(x-y) (9) 25、25 (10) 27 (11) 4 (12) 0 三、选择题 1 2 3 4 5 6 7 8 9 10 11 12 D D C B D A D B C D A B 四、编程题 1. #include main() { int x, a, b, c; printf("Enter a intger number x=?\n"); scanf("%d",&x); a=x /100; b=x%100/10; c=x%10; printf("%d %d %d\n", a, b, c); } 2. #include main() { unsigned a, b,r1,r2,r3; scanf("%u%u", &a, &b); r1=a &b; r2=a|b; r3=a^b; printf("r1=%u,r2=%u,r3=%u\n",r1,r2,r3); getch(); } 3. #include main() { float a, b, h, s; scanf("%f%f?%f", &a, &b, &h); s=(a+b)*h/2; printf("s=%f\n", s); } 第3 章 习题参考答案 一、判断题 1 2 3 4 5 6 × × × √ √ × 2 填空题 3 语句 4 表达式语句 5 { } 6 函数 7 由“%”和格式字符 8 & 9 getchar() 10 27 ,33 ,1b 11 x(1)=23.14 x(2)=-78.32 12 5+ 6 3 程序阅读题 1、 p=3.14 p=3.1416 p= 3.14 p= 3.1416 p=3.14 p=3.1416 2、 a----ASCII: 97 a----ASCII: 97 a----ASCII: 97 4 编程题 1、 #include