题解 | 计算商品打折结算金额
计算商品打折结算金额
https://www.nowcoder.com/practice/055a92b5c93f497291a58c232f59fae9
#include <stdio.h>
int main() {
float x;
scanf("%f",&x);
if (x >= 100 && x <500)
printf("%f",x*0.9);
else if (x >= 500 && x < 2000)
printf("%f",x*0.8);
else if (x >=2000 && x < 5000)
printf("%f",x*0.7);
else if (x >= 5000)
printf("%f",x*0.6);
return 0;
}