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