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