第1 章习题 一、选择题 1、A 2、D 3、C 4、D 5、B 6、C 7、C 8、B 9、B 10、A 二、填空题 1、一,函数体 2、main(主),main(主) 3、编译,目标 4、
exe 5、缩进,无影响,/* */ 三、程序分析题 1、 ***************** Very good
***************** 2、 a=12,b=5 a=17,b=22 3、 r= 5
50,s=95
033098 四、编程题 1.用 printf()函数在屏幕上输出自己的班级、学号、姓名
#include"stdio
h" void main() { printf("班级:BX1109\n"); printf("学号:111003530901\n"); printf("姓名:王孟荣\n"); } 2.从键盘输入两个整数,计算它们的和、差、积、商,并在屏幕上输出结果
#include void main() { int x,y,a,b,c; float d; printf("Please Input Two Integers:\n"); scanf("%d%d",&x,&y); a=x+y; b=x-y; c=x*y; d=1
0*x/y; printf("a=%d\nb=%d\nc=%d\nd=%f\n",a,b,c,d); } 第2 章习题 一、选择题 1~5 BCDCD 6~10 DBBCA 二、填空题 1.单精度浮点型、双精度浮点型、字符型 2.0 3.x%10*10+x/10 4.5
7 20 6.sin(sqrt(x*x))/(a*b) 7. , 8.1111011 173 7B 9.3 3 10.3 三、程序分析题 1. 7,8,10 2. 1,3 3
5 F 4. (int)i=12, 12
50 5. 4