标签:ios i++ main 水题 end iostream return 工资 mes
201612-2 工资计算
#include<iostream> using namespace std; int main() { int n; cin >> n; for(int i=1;i<=1000;i++) { int T=i*100; int cnt=T-3500; int fei=0; int ans=T-n; if(cnt<=0&&T==n) { cout << T << endl; break; } if(cnt<=0) continue; if(cnt<=1500) { fei+=cnt*0.03; if(fei==ans) { cout << T << endl; break; } continue; } if(cnt<=4500) { fei+=1500*0.03+(cnt-1500)*0.1; if(fei==ans) { cout << T << endl; break; } continue; } if(cnt<=9000) { fei+=1500*0.03+3000*0.1+(cnt-4500)*0.2; if(fei==ans) { cout << T <<endl; break; } continue; } if(cnt<=35000) { fei+=1500*0.03+3000*0.1+4500*0.2+(cnt-9000)*0.25; if(fei==ans) { cout << T << endl; break; } continue; } if(cnt<=55000) { fei+=1500*0.03+3000*0.1+4500*0.2+26000*0.25+(cnt-35000)*0.3; if(fei==ans) { cout << T << endl; break; } continue; } if(cnt<=80000) { fei+=1500*0.03+3000*0.1+4500*0.2+26000*0.25+20000*0.3+(cnt-55000)*0.35; if(fei==ans) { cout <<T <<endl; break; } continue; } if(cnt>80000) { fei+=1500*0.03+3000*0.1+4500*0.2+26000*0.25+20000*0.3+25000*0.35+(cnt-80000)*0.45; if(fei==ans) { cout << T << endl; break; } continue; } } return 0; }
标签:ios i++ main 水题 end iostream return 工资 mes
原文地址:https://www.cnblogs.com/jc12138/p/9622766.html