解题思路:
注意事项:
参考代码:
#include <stdio.h> int main() { int profit; float bonus; scanf("%d", &profit); if(profit <= 100000) { bonus = profit*0.1; } else if(profit > 100000 && profit <= 200000){ bonus = ((profit - 100000) * 0.075 + 10000*0.1 ); } else if(profit > 200000 && profit <= 400000){ bonus = (profit - 200000) * 0.05 + 20000 * 0.1; } else if(profit > 400000 && profit <= 600000){ bonus = (profit - 400000) * 0.03 + 40000 * 0.1; }else if(profit > 600000 && profit <= 1000000){ bonus = (profit - 600000) * 0.015 + 600000 * 0.1; }else { bonus = (profit - 1000000) * 0.01 + 1000000 * 0.1; } printf("%.0f\n", bonus); return 0; }
0.0分
0 人评分