解题思路:
注意事项:
参考代码:
#include<stdio.h>
int main(void)
{
int profit; //利润
int bonus; //奖金
scanf("%d",&profit);
if(profit<=100000)
bonus=profit*0.1;
else if(profit<=200000)
bonus=100000*0.1+(profit-100000)*0.075;
else if(profit<=400000)
bonus=100000*0.1+100000*0.075+(profit-200000)*0.05;
else if(profit<=600000)
bonus=100000*0.1+100000*0.075+200000*0.05+(profit-400000)*0.03;
else if(profit<=1000000)
bonus=100000*0.1+100000*0.075+200000*0.05+200000*0.03+(profit-600000)*0.015;
else
bonus=100000*0.1+100000*0.075+200000*0.05+200000*0.03+400000*0.015+(profit-1000000)*0.01;
printf("profit is %d,bonus is %d.",profit,bonus);
}
0.0分
0 人评分
2005年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:497 |
简单的a+b (C语言代码)浏览:534 |
淘淘的名单 (C语言代码)答案错误???浏览:595 |
WU-蓝桥杯算法提高VIP-Quadratic Equation (C++代码)浏览:1757 |
校门外的树 (C语言代码)浏览:705 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:609 |
简单的a+b (C语言代码)浏览:583 |
母牛的故事 (C语言代码)浏览:1429 |
Hello, world! (C++代码)浏览:1746 |
Cylinder (C语言描述+详细分析)浏览:3271 |