云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > C语言谭浩强(第三版)课后答案

C语言谭浩强(第三版)课后答案

  • 62 次阅读
  • 3 次下载
  • 2025/6/15 10:02:39

else if(num>999) place=4; else if(num>99) place=3; else if(num>9) place=2; else place=1;

printf(\printf(\每位数字为:\ten_thousand=num/10000;

thousand=(num-tenthousand*10000)/1000;

hundred=(num-tenthousand*10000-thousand*1000)/100; ten=(num-tenthousand*10000-thousand*1000-hundred*100)/10;

indiv=num-tenthousand*10000-thousand*1000-hundred*100-ten*10; switch(place) {case

5:printf(\,ten,indiv);

printf(\反序数字为:\

printf(\

housand); break;

case 4:printf(\ printf(\反序数字为:\

printf(\ break;

case 3:printf(\ printf(\反序数字为:\

printf(\case 2:printf(\ printf(\反序数字为:\ printf(\case 1:printf(\ printf(\反序数字为:\ printf(\ } }

5.8 1.if语句 main() {long i;

float bonus,bon1,bon2,bon4,bon6,bon10; /*初始化变量*/

bon1=100000*0.1; bon2=100000*0.075+bon1; bon4=200000*0.05+bon2; bon6=200000*0.03+bon4; bon10=400000*0.015+bon6; printf(\请输入利润\scanf(\/*计算*/ if(i<=le5) bonus=i*0.1; else if(i<2e5)

bonus=bon1+(1-100000)*0.075; else if(i<=4e5)

bonus=bon2+(i-200000)*0.05; else if(i<=6e5)

bonus=bon4+(i-400000)*0.03; else if(i<=le6)

bonus=bon6+(i-600000)*0.015; else

bonus=bon10+(i-1000000)*0.01; printf(\奖金是 .2f\}

用switch语句编程序 main() {long i;

float bonus,bon1,bon2,bon4,bon6,bon10; int branch; /*初始化变量*/ bon1=100000*0.1; bon2=bon1+100000*0.075 bon4=bon2+200000*0.05; bon6=bon4+200000*0.03; bon10=bon6+400000*0.015; printf(\请输入利润:\scanf(\branch=i/100000; if(branch>10) branch=10; /*计算*/ switch(branch)

{case 0:bonus=i*0.1;break;

case 1:bonus=bon1+(i-100000)*0.075;break; case 2:

case 3:bonus=bon2+(i-200000)*0.05;break;

搜索更多关于: C语言谭浩强(第三版)课后答案 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

else if(num>999) place=4; else if(num>99) place=3; else if(num>9) place=2; else place=1; printf(\printf(\每位数字为:\ten_thousand=num/10000; thousand=(num-tenthousand*10000)/1000; hundred=(num-tenthousand*10000-thousand*1000)/100; ten=(num-tenthousand*10000-thousand*1000-hundred*100)/10; indiv=num-tenthousand*10000-thousand*1000-hundred*100-ten*10; switch(place) {case

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com