c语言程序设计谭浩强题库,谭浩强c语言程序设计习题答案

41528d3028836879cd698677c3999917.gif谭浩强c语言程序设计习题答案

1 谭浩强C 语言程序设计习题参考答案 第一章 1.6 main() {int a,b,c,max;printf(“ three numbers:\n“);scanf(“%d,%d,%d“,max=a;if(maxb)?a:b;max=(c>temp)?c:temp;printf(“max=%d“,max); }4.5 main() {int x,y;scanf(“%d“,if(x=0else 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_thousand*10000)/1000;hundred=(num-ten_thousand*10000-thousand*1000)/100;ten=(num-ten_thousand*10000-thousand*1000-hundred*100)/10;indiv=num-ten_thousand*10000-thousand*1000-hundred*100-ten*10;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);} } 4.8 main() {long i;float bonus,bon1,bon2,bon4,bon6,bon10;bon1=100000*0.1;bon2=bon1+100000*0.075;bon4=bon2+200000*0.05;bon6=bon4+200000*0.03;bon10=bon6+400000*0.015;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值