解题思路:
将利润除以100000,所得数使用switch函数进行选择。
注意事项:
参考代码:
#include int main(){ int i,t; scanf("%d",&i); int m = i/100000; switch(m){ case 0: t=i*0.1;break; case 1:t=10000+(i-100000)*0.075;break; case 2: case 3:t=17500+(i-200000)*0.05;break; case 4: case 5:t=27500+(i-400000)*0.03;break; case 6: case 7: case 8: case 9:t=33500+(i-600000)*0.015;break; default:t=39500+(i-1000000)*0.01;break; } printf("%d",t); return 0 ; }
0.0分
1 人评分
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:600 |
C语言训练-列出最简真分数序列* (C语言代码)浏览:537 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:482 |
C语言程序设计教程(第三版)课后习题11.8 (C语言代码)浏览:907 |
【金明的预算方案】 (C++代码)浏览:988 |
剪刀石头布 (C语言代码)浏览:792 |
Hello, world! (C语言代码)浏览:911 |
The 3n + 1 problem (C语言代码)浏览:541 |
图形输出 (C语言代码)浏览:1012 |
数组输出 (C语言代码)浏览:745 |