CCF—工资计算 20161202

来源:互联网 发布:华中科技大学软件下载 编辑:程序博客网 时间:2024/05/29 12:21
#include <iostream>
using namespace std;
int main() {
    int t,s,temp; 
    cin>>t; 
int a1=1500*0.97,          b1=a1;
int a2=(4500-1500)*0.9,    b2=b1+a2;
int a3=(9000-4500)*0.8,    b3=b2+a3;
int a4=(35000-9000)*0.75,  b4=b3+a4;
int a5=(55000-35000)*0.7,  b5=b4+a5;
int a6=(80000-55000)*0.65, b6=b5+a6;
    temp=t-3500;
if(temp<0) s=t;
     else if(temp<=b1&&temp>0)  s=3500+temp/0.97;
   else if(temp<=b2&&temp>b1) s=5000+(temp-b1)/0.9;
   else if(temp<=b3&&temp>b2) s=8000+(temp-b2)/0.8;
   else if(temp<=b4&&temp>b3) s=12500+(temp-b3)/0.75;
   else if(temp<=b5&&temp>b4) s=38500+(temp-b4)/0.7;
   else if(temp<=b6&&temp>b5) s=58500+(temp-b5)/0.65;
   else if(temp>b6)           s=83500+(temp-b6)/0.55;
cout<<s<<endl;

}
 
原创粉丝点击