c语言程序设计答案吉林大学,C语言程序设计课后习题答案吉林大学版武爱平.doc...

word完美格式

精心整理 学习帮手

第一章

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) = 1 \* GB3 ① 9

= 2 \* GB3 ②-2

= 3 \* GB3 ③ 62

= 4 \* GB3 ④44.8

(2)

= 1 \* GB3 ① 10.5 = 2 \* GB3 ② 73.1 = 3 \* GB3 ③ 7

= 4 \* GB3 ④7.2

(3)"%6x" "%o""%3c""%10.3f"

(4)int a,b,c; &a,&b,&c temp=a; c=temp;

(5)49

61311

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(4)C(5)D(6)A(7)C(8)A(9)B(10)D

2、填空题

(1)&m,&n

m=n;

n=temp;

m,n

(2) = 1 \* GB3 ① 5 5 4

= 2 \* GB3 ② 5 5 4 = 3 \* GB3 ③ 3 3 4

(3)9

i+1

"%d",i

printf("\n");

(4)73

-543

93201

3、程序设计题

(1)

#include

#include

main()

{

double a,b,c,d,det,a_2,real,imag,x1,x2;

printf("Please enter a,b,c:");

scanf("%lf%lf%lf",&a,&b,&c);

if(a==0&&b==0)

printf("No root!\n");

else if(a==0)

printf("Line equation root is %.2lf\n",-c/b);

else

{

d=b*b-4*a*c;

det=sqrt(fabs(d));

a_2=2*a;

if(d<0)

{

real=-b

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值