解题思路:
注意事项:
参考代码:
#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 人评分
震宇大神的杀毒软件 (C语言代码)浏览:1240 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:572 |
Tom数 (C++代码)浏览:826 |
C二级辅导-公约公倍 (C语言代码)浏览:1508 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:608 |
简单的a+b (C语言代码)浏览:524 |
A+B for Input-Output Practice (V) (C语言代码)浏览:617 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:594 |
WU-格式化数据输出 (C++代码)浏览:1194 |
printf基础练习2 (C语言代码)浏览:644 |