解题思路:
注意事项:
参考代码:
#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语言训练-求函数值 (C语言代码)浏览:937 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:572 |
大神老白 (C语言代码)浏览:645 |
简单的a+b (C语言代码)浏览:631 |
1017题解浏览:605 |
数组与指针的问题浏览:717 |
字符逆序 (C语言代码)浏览:509 |
矩阵转置 (C语言代码)浏览:783 |
母牛的故事 (C语言代码)浏览:570 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:459 |