解题思路:
注意事项:
参考代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
int profit = 0;
float award = 0;
cin >> profit;
if(profit < 0) {
return -1;
} else if(profit <= 100000) {
award = 0.1 * profit;
} else if(profit <= 200000) {
award = 0.075 * (profit - 100000) + 10000;
} else if(profit <= 400000) {
award = 0.05 * (profit - 200000) + 17500;
} else if(profit <= 600000) {
award = 0.03 * (profit - 400000) + 27500;
} else if(profit <= 1000000) {
award = 0.015 * (profit - 600000) + 33500;
} else {
award = 0.01 * (profit - 1000000) + 39500;
}
cout << award << endl;
return 0;
}
0.0分
1 人评分
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:1059 |
A+B for Input-Output Practice (IV) (C++代码)浏览:713 |
字符串比较 (C语言代码)答案错误????浏览:641 |
妹子杀手的故事 (C语言代码)浏览:1297 |
WU-整除问题 (C++代码)浏览:648 |
简单的a+b (C语言代码)浏览:626 |
完数 (C语言代码)浏览:757 |
循环入门练习6 (C语言代码)浏览:1058 |
C语言程序设计教程(第三版)课后习题12.1 (C语言代码)浏览:689 |
简单的事情 (C语言代码)浏览:679 |