brsmsg 提交的代码
提交时间:2020年6月17日 00:23 语言:C++运行时间:0ms占用内存:253K
运行状态: Accepted
题目:利润提成1040

大会员可查看代码,点此开通大会员

                
                    #include <iostream>
using namespace std;

int main(){
	int prof, bonus;
	scanf("%d", &prof);
	if(prof <= 100000){
		bonus = prof * 0.1;
	}else if(prof <= 200000){
		bonus = 100000*0.1 + (prof - 100000)*0.075;
	}else if(prof <= 400000){
		bonus = 100000*0.1 + 100000*0.075 + (prof - 200000) * 0.05;
	}else if(prof <= 600000){
		bonus = 100000*0.1 + 100000*0.075 + 200000 * 0.05 + (prof- 600000)*0.015;
	}else{
		bonus = 100000*0.1 + 100000*0.075 + 200000 * 0.05 + 400000*0.015 + (prof-1000000)*0.01;
	}
	cout<<bonus<<endl;
	return 0;
}