DevForge学编程社区慕课西北工业大学C++程序设计练习题6 奖金发放
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/370dcf0fc635519a09b0e1ed1f035b87.png)
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
int profit;
double bonus;
cin>>profit;
if(profit<=10){
bonus=profit*0.1;
}
if(profit>10&&profit<20){
bonus=10*0.1+(profit-10)*0.075;
}
if(profit>=20&&profit<40){
bonus=10*0.1+10*0.075+(profit-20)*0.05;
}
if(profit>=40&&profit<60){
bonus=10*0.1+10*0.075+20*0.05+(profit-40)*0.03;
}
if(profit>=60&&profit<100){
bonus=10*0.1+10*0.075+20*0.05+20*0.03+(profit-60)*0.015;
}
if(profit>100){
bonus=10*0.1+10*0.075+20*0.05+20*0.03+40*0.015+(profit-100)*0.01;
}
cout<<fixed<<setprecision(6)<<bonus;
}