}
putchar(letter3+32); putchar(letter4+32); putchar(letter5+32); putchar('\\n'); return 0;
习题4
1.(A) 76 (B) 7 (C) 22 (D) 3.5
2.(A) 9 (B) 8 (C) 7 (D) 6 3.B
4. (A) 12 (B) 13 (C) 12.08 (D) 20.0 5. (B) 3 6. (A) 72
7. (D) 2*x, x += 2 8. (C) c<'Z' && c >= 65 9.
3,1 3,1 0,3,1 1,3,1 10.c,c,c 99,99,99 11.x=7,y=3 z=18 12.T
0 1 1
13.一共4条语句 14.
#include
int main(){
int a,b,c;
double result;
printf(\请从键盘输入a,b,c的值,数之间用空格或回车分隔:\\n\ scanf(\ result =2.0/3*a+5.0/6*b+6.0/7*c; printf(\ printf(\ return 0;
} 15.
#include
int main(){
int number; short position1,position2,position3,position4 ; printf(\请从键盘输入number的值:\
scanf(\position4 =number/1000; position2 =number0/10;
position3 =number00/100;
position1 =number; printf(\中个位上的数字是%d\\n\ }
printf(\中十位上的数字是%d\\n\printf(\中百位上的数字是%d\\n\printf(\中千位上的数字是%d\\n\return 0;
习题5
1.y = 100;;处多了一个分号。
2.(A)_10,129___(B)2,-129__(C)__55,129___(D)_2,0_ 3. Tiger
#include
int x = 10; if(x >= 0){ if(x>0){ printf(\ } else{ printf(\ }
} else{ printf(\ }
return 0; } 4. 30。
5.BAAA 6.
#include
if(a>c) { temp = a; a = c; c = temp; count++;
printf(\第%d次排序结果:a=%d,b=%d,c=%d,d=%d\\n\ }
if(a>d) { temp = a; a = d; d = temp; count++; printf(\第%d次排序结果:a=%d,b=%d,c=%d,d=%d\\n\ } if(b>c) { temp = b; b = c; c = temp; count++; printf(\第%d次排序结果:a=%d,b=%d,c=%d,d=%d\\n\ } if(b>d) { temp = b; b = d; d = temp; count++; printf(\第%d次排序结果:a=%d,b=%d,c=%d,d=%d\\n\ } if(c>d) { temp = c; c = d; d = temp; count++; printf(\第%d次排序结果:a=%d,b=%d,c=%d,d=%d\\n\ } if(count == 0) { printf(\ } return 0; } 7.
#include