解题思路:
注意事项:
参考代码:
#include <stdio.h>
int main()
{
double profit,total=0;//利润、奖金
scanf("%lf",&profit);
switch((int)profit/100000){
default:
case 10:total+=(profit-1000000)*0.01;profit=1000000;
case 9:
case 8:
case 7:
case 6:total+=(profit-600000)*0.015;profit=600000;
case 5:
case 4:total+=(profit-400000)*0.03;profit=400000;
case 3:
case 2:total+=(profit-200000)*0.05;profit=200000;
case 1:total+=(profit-100000)*0.075;profit=100000;
case 0:total+=profit*0.1;
}
printf("%.2lf\n",total);
}
0.0分
0 人评分
C语言训练-大、小写问题 (C语言代码)浏览:2357 |
C语言训练-求函数值 (C语言代码)浏览:939 |
回文串 (C语言代码)浏览:2860 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:605 |
C语言程序设计教程(第三版)课后习题6.6 (C++代码)浏览:633 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:474 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:561 |
核桃的数量 (C语言代码)浏览:672 |
1118(求助_已解决)浏览:329 |
敲七 (C++代码)浏览:1056 |