//如果是老谭的,你看看下面是否是你要的。
第三章 34
main()
{int a,b,c;
long int u,n;
float x,y,z;
char c1,c2;
a=3;b=4;c=5;
x=12;y=24;z=-36;
u=51274;n=128765;
c1='a';c2='b';
printf("\n");
printf("a=%2d b=%2d c=%2d\n",a,b,c);
printf("x=%86f,y=%86f,z=%96f\n",x,y,z);
printf("x+y=%52f y+z=%52f z+x=%52f\n",x+y,y+z,z+x);
printf("u=%6ld n=%9ld\n",u,n);
printf("c1='%c'or %d(ASCII)\n",c1,c1);
printf("c2='%c'or %d(ASCII)\n",c2,c2);
}
35
57
5 7
67856400,-789123962
67856400,-789123962
6786 -78912,67856400,-789123962,67856400,-789123962
6785640e+001,-789e+002
A,65,101,41
1234567,4553207,d687
65535,177777,ffff,-1
COMPUTER, COM
36
a=3 b=7/
x=85 y=7182/
c1=A c2=a/
37
10 20Aa15 -375 +14,678/
(空 3)10(空3)20Aa15(空1)-375(空1)(随意输入一个数),678 回车
38
main()
{float pi,h,r,l,s,sq,sv,sz;
pi=31415926;
printf("input r,h\n");
scanf("%f,%f",&r,&h);
l=2pir;
s=rrpi; sq=4pirr;
sv=40/30pirrr;
sz=pirrh;
printf("l=%62f\n",l);
printf("s=%62f\n",s);
printf("sq=%62f\n",sq);
printf("vq=%62f\n",sv);
printf("vz=%62f\n",sz);
}
39
main()
{float c,f;
scanf("%f",&f);
c=(50/90)(f-32);
printf("c=%52f\n",c);
}
310
#include"stdioh"
main()
{char c1,c2;
scanf("%c,%c",&c1,&c2);
putchar(c1);
putchar(c2);
printf("\n");
printf("%c%c\n",c1,c2);
}
43
(1)0 (2)1 (3)1 (4)0 (5)1
44
main()
{int a,b,c;
scanf("%d,%d,%d",&a,&b,&c);
if(a<b)
if(b<c)
printf("max=%d\n",c);
else
printf("max=%d\n",b);
else if(a<c)
printf("max=%d\n",c);
else
printf("max=%d\n",a);
}
main() {int a,b,c,temp,max;
scanf("%d,%d,%d",&a,&b,&c);
temp=(a>b)a:b;
max=(c>temp)c:temp;
printf("max=%d",max);
}
45
main()
{int x,y;
scanf("%d",&x);
if(x<1)y=x;
else if(x<10)y=2x-1;
else y=3x-11;
printf("y=%d",y);
}
46
main()
{int score,temp,logic;
char grade;
logic=1;
while(logic)
{scanf("%d",&score);
if(score>=0&&score<=100)logic=0;
}
if(score==100)
temp=9;
else
temp=(score-score%10)/10;
switch(temp)
{case 9:grade='A';break;
case 8:grade='B';break;
case 7:grade='C';break;
case 6:grade='D';break;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:grade='E';
}
printf"score=%d,grade=%c",score,grade);
}
47 main()
{long int num;
int indiv,ten,hundred,thousand,ten_thousand,place;
scanf("%ld",&num);
if(num>9999) place=5;
else if(num>999) place=4;
else if(num>99) place=3;
else if(num>9) place=2;
else place=1;
printf("place=%d\n",place);
ten_thousand=num/10000;
thousand=(num-ten_thousand10000)/1000;
hundred=(num-ten_thousand10000-thousand1000)/100;
ten=(num-ten_thousand10000-thousand1000-hundred100)/10;
indiv=num-ten_thousand10000-thousand1000-hundred100-ten10;
switch(place)
{case 5:printf("%d,%d,%d,%d,%d\n",ten_thousand,thousand,hundred,ten,indiv);
printf("%d,%d,%d,%d,%d\n",indiv,ten,hundred,thousand,ten_thousand);
break;
case 4:printf("%d,%d,%d,%d\n",thousand,hundred,ten,indiv);
printf("%d,%d,%d,%d\n",indiv,ten,hundred,thousand);
break;
case 3:printf("%d,%d,%d\n",hundred,ten,indiv);
printf("%d,%d,%d\n",indiv,ten,hundred);
break;
case 2:printf("%d,%d\n",ten,indiv);
printf("%d,%d\n",indiv,ten);
break;
case 1:printf("%d\n",indiv);
printf("%d\n",indiv);
}
}
48
main()
{long i;
float bonus,bon1,bon2,bon4,bon6,bon10;
bon1=10000001;
bon2=bon1+1000000075;
bon4=bon2+200000005;
bon6=bon4+200000003;
bon10=bon6+4000000015;
scanf("%ld",&i);
if(i<=1e5)bonus=i01;
else if(i<=2e5)bonus=bon1+(i-100000)0075; else if(i<=4e5)bonus=bon2+(i-200000)005;
else if(i<=6e5)bonus=bon4+(i-400000)003;
else if(i<=1e6)bonus=bon6+(i-600000)0015;
else bonus=bon10+(i-1000000)001;
printf("bonus=%102f",bonus);
}
main()
{long i;
float bonus,bon1,bon2,bon4,bon6,bon10;
int branch;
bon1=10000001;
bon2=bon1+1000000075;
bon4=bon2+200000005;
bon6=bon4+200000003;
bon10=bon6+4000000015;
scanf("%ld",&i);
branch=i/100000;
if(branch>10)branch=10;
switch(branch)
{case 0:bonus=i01;break;
case 1:bonus=bon1+(i-100000)0075;break;
case 2:
case 3:bonus=bon2+(i-200000)005;break;
case 4:
case 5:bonus=bon4+(i-400000)003;break;
case 6:
case 7
case 8:
case 9:bonus=bon6+(i-600000)0015;break;
case 10:bonus=bon10+(i-1000000)001;
}
printf("bonus=%102f",bonus);
}
49
main()
{int t,a,b,c,d;
scanf("%d,%d,%d,%d",&a,&b,&c,&d);
if(a>b){t=a;a=b;b=t;}
if(a>c){t=a;a=c;c=t;}
if(a>d){t=a;a=d;d=t;}
if(b>c){t=b;b=c;c=t;}
if(b>d){t=b;b=d;d=t;}
if(c>d){t=c;c=d;d=t;} printf("%d %d %d %d\n",a,b,c,d);
}
410
main()
{int h=10;
float x,y,x0=2,y0=2,d1,d2,d3,d4;
scanf("%f,%f",&x,&y);
d1=(x-x0)(x-x0)+(y-y0)(y-y0);
d2=(x-x0)(x-x0)+(y+y0)(y+y0);
d3=(x+x0)(x+x0)+(y-y0)(y-y0);
d4=(x+x0)(x+x0)+(y+y0)(y+y0);
if(d1>1&&d2>1&&d3>1&&d4>1)h=0;
printf("h=%d",h);
}
书后面不是有答案?当时我上的时候是有答案的,难道现在没有了吗?
只是没有编程题的源程序罢了
别指望什么答案,当时给的答案就有好多是错误的,我问过吴老师不少题,她说书在不断完善中,错误难免的,还是自己练习
本书是学习C语言程序设计的基础教程,内容包括C语言概述、顺序结构程序设计、分支结构程序设计、循环结构程序设计、数组、函数、指针、结构体、文件等。
本书以程序设计思想的掌握为主线,以编程应用为驱动,通过案例和问题引入内容,由浅入深,循序渐进,重点训练学生的编程思想,能够充分提高学生的编程能力,锻炼学生的工程能力和创新能力,并鼓励学生利用所学C语言知识解决专业的具体问题。
本书是为“卓越工程师教育培养计划”本科专业编写的计算机教材,强化编程能力、工程能力和创新能力; 也可以作为其他应用型本科理工类专业的计算机应用教材。
以上就是关于c语言第四章的答案全部的内容,包括:c语言第四章的答案、急需 高等教育出版社 c\c++程序设计(吴国凤 宣善立 主编 第二版) 课后习题答案及解析 急用!、2014贾宗璞c语言程序设计第二版答案等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)