- #include<stdio.h>
- int main(){
- double money;
- double result;
- printf("请输入当月利润:\n");
- scanf("%lf",&money);
- int num = money / 100000;
- switch (num) {
- case 0:
- result = money * 0.1;
- break;
- case 1:
- result = 10000 + (money-100000) * 0.075;
- break;
- case 2:
- case 3:
- result = 10000 + 7500 + (money - 200000) * 0.05;
- break;
- case 4:
- case 5:
- result = 10000 + 7500 + 10000 + (money - 400000) * 0.03;
- break;
- case 6:
- case 7:
- case 8:
- case 9:
- result = 10000 + 7500 + 10000 + 6000 + (money - 600000) * 0.015;
- break;
- default:
- result = 10000 + 7500 + 10000 + 6000 + 6000 + (money - 1000000) * 0.01;
- break;
- }
- printf("待遇是:%.2lf\n",result);
- }
复制代码 |