<swustoj>?id=37 利润提成
链接http://acm.swust.edu.cn/problem/0037/
#include <stdio.h> int main() { int bonus(int profit); int profit; scanf("%d",&profit); printf("%d\n",bonus(profit)); return 0; } int bonus(int profit) { if(profit<=100000) { return profit*0.1; } else { if(profit<=200000) { return 100000*0.1+(profit-100000)*0.075; } else { if(profit<=400000) { return 100000*0.175+(profit-200000)*0.05; } else { if(profit<=600000) { return 100000*0.225+(profit-400000)*0.03; } else { if(profit<=1000000) { return 100000*0.285+(profit-600000)*0.015; } else { return 100000*0.345+(profit-1000000)*0.01; } } } } } }

浙公网安备 33010602011771号