第一章
1.选择题
(1)B (2 )C (3)C (4 )D (5 )B (6)D (7 )D (8 )C
2.填空题
(1)函数
一个主函数
函数
(2 )/*
*/
(3)连接
3.程序设计题
(1)
#include
main()
{
printf(" *\n");
printf("* S *\n");
printf(" *\n");
}
(2 )
#include
main()
{
printf("******************\n");
printf("Your are welcome!\n");
printf("\n");
}
第二章
1.选择题
(1)D (2 )D (3) B (4 )C (5 )B (6)C (7 )C (8)C (9)D (10)C (11)A (12)B
(13 )A (14)C (15)A (16)B (17 )A (18)B (19)C (20 )A (21 )C (22)C
2.填空题
(1)① 9
② - 2
③ 62
④ 44.8
(2 )
① 10.5
② 73.1
③ 7
④7.2
(3)"%6x"
"%o"
"%3c"
"%10 .3f"
"%8s"
(4 )int a,b,c;
&a,&b,&c
temp=a;
c=temp;
(5)49
61
31
1
3.程序设计题
(1)
#include
main()
{
double a,b,c,d;
double aver=0.0;
printf("\nPlease input four double number:");
scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
aver=(a+b+c+d)/4;
printf("\nThe average of the four double number is %lf",aver);
}
(2 )
#include
#define PI 3.14159
main()
{
double r;
double area=0,len=0;
printf("\nPlease input r:");
scanf("%lf",&r);
area=PI*r*r;
len=2*PI*r;
printf("\n area=%lf,length=%lf",area,len);
}
(3 )
#include
main()
{
float i,s;
printf("\nPlease input data:");
scanf("%f%f",&i,&s);
s=s*(1+i);
printf("\nI have %.2f yuan after one year.",s);
}
第三章
1、选择题
(1)C (2 )C (3)A