文章

8

粉丝

0

获赞

119

访问

3.5k

头像
利润提成 题解:
P1040 北京大学机试题
发布于2025年2月18日 17:02
阅读数 516

注意奖金提成根据利润来算,但是不包括利润!
#include <bits/stdc++.h>
using namespace std;

int main(){
    int profit = 0;
    int bonus = 0;
    cin >> profit;
    if (profit <= 100000) {
        bonus = 0.1 * profit;
    }
    else if (profit <= 200000) {
        bonus = 0.1*100000 + 0.075*(profit-100000);
    }
    else if (profit <= 400000) {
        bonus = 0.1*100000 + 0.075*100000 + 0.05*(profit-200000);
    }
    else if (profit <= 600000) {
        bonus = 0.1*100000 + 0.075*100000 + 0.05*200000 + 0.03*(profit-400000);
    }
    else if (profit <= 1000000) {
        bonus = 0.1*100000 + 0.075*100000 + 0.05*200000 + 0.03*2000...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发