1 条题解

  • 2
    @ 2023-1-12 12:09:47

    阿巴阿巴……

    #include<iostream>
    #include<iomanip>
    #include<stdio.h>
    #include<math.h>
    #include<string>
    #include<cstring>
    using namespace std;
    double n,tc,sum=0;//利润,提成,奖金
    void js(double n,double tc,double bf1,double bf2){//bf1和bf2为判断部分
    	if(n>bf1){
    		if(n<bf2)sum+=(n-bf1)*tc;
    		else sum+=(bf2-bf1)*tc;
    	}else return;
    }
    int main(){
    	cin>>n;
    	js(n,0.1,0,100000);
    	js(n,0.075,100000,200000);
    	js(n,0.05,200000,400000);
    	js(n,0.03,400000,600000);
    	js(n,0.015,600000,1000000);
    	js(n,0.01,1000000,pow(10,10));//这里的bf2没有上限,pow(a,b)=a的b次方
    	printf("%.2lf",sum);
    	return 0;
    }
    
    • 1

    信息

    ID
    860
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    递交数
    59
    已通过
    20
    上传者