解题思路:无脑ifelse
注意事项:
参考代码:
#include<stdio.h>
int main()
{
int prize,profit;
scanf("%d",&profit);
if(profit <= 100000){
prize = 0.1 * profit;
}else if(profit > 100000 && profit <= 200000){
prize = 100000 * 0.1 + (profit - 100000) * 0.075;
}else if(200000<profit&&profit<=400000){
prize = 100000 * 0.1 + (200000-100000) * 0.075 + (profit - 200000)*0.05;
}else if(400000<profit&&profit<=600000){
prize = 100000 * 0.1 + (200000-100000) * 0.075 + (400000-200000) * 0.05 + (profit - 400000) * 0.03;
}else if(600000<profit&&profit<=1000000){
prize = 100000 * 0.1 + (200000-100000) * 0.075 + (400000-200000) * 0.05 + (600000 - 400000) * 0.03 + (profit-600000)*0.015;
}else if(profit>1000000){
prize = 100000 * 0.1 + (200000-100000) * 0.075 + (400000-200000) * 0.05 + (600000 - 400000) * 0.03 + (1000000-600000)*0.015 + (profit-1000000)*0.01;
}
printf("%d",prize);
return 0;
}
0.0分
2 人评分
C语言程序设计教程(第三版)课后习题12.5 (C语言代码)浏览:875 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:2498 |
不会做的浏览:954 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)万恶的long long浏览:906 |
C语言程序设计教程(第三版)课后习题6.5 (C++代码)浏览:487 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:895 |
1009题解浏览:802 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:1968 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:650 |
C语言训练-大、小写问题 (C语言代码)浏览:719 |
达咩 2021-10-07 09:02:44 |
确实