写出下面输出语句的结果。[答案] (1)printf(“%d\n”,x); (2)printf(“%10d\n”,x); (3)printf(“%4d\n”,x); 2.7 (1)12345 (2)XXXXX12345 个空格)(3)12345 (宽度不够,突破限制) 2.8 设y=12345.678。写出下面输出语句的结果。[答案] (1)printf(“%f”,y); (2)printf(“%10.3f”,y); (3)printf(“%8.3f”,y); (4)printf(“%8.5f”,y); 2.8 (1)12345.678000(默认6 位小数) (2)X12345.678 (左补一个空格) (3)12345.678 (宽度不够,突破限制) (4)12345.67800 (突破限制,按小数位显示) 3.5 某工种按小时计工资,每月总工资=每月劳动时间(小时)每小时 工资,总工资中要扣除 10% 的公积金,剩余为应发工资。劳动时间和每小时 工资由键盘输入,求应发工资。[N-S 图][答案] main() {int hour; float wage,salary; printf("输入工时:"); scanf("%d",&hour); printf("输入工资标准:"); scanf("%f",&wage); salary=wage*hour*(1-0.1); printf("应发工资为::%5.2f\n",salary); 3.6计算圆的直径、周长和面积。圆的半径从键盘输入,圆周率分别取 3.14、3.14159。[N-S 图][答案] #definePI 3.14159 /*3.14*/ main() {float area,diameter,radius,perimeter; printf("input radius:"); scanf("%f",&radius); diameter=2*radius; area=PI*radius*radius; perimeter=2*PI*radius; printf("diameter %5.2f\n",diameter);printf("area %5.2f\n",area);printf("perimeter 3.7输入a,b 两个整数,求a 除以b 得到的商和余数。 [N-S 图][答案] main()