某商场推出打折促销活动:若顾客购物额不满 100 元则不优惠;达到或超过 100 元则九五折优惠;达到或超过 200 元则九折优惠;达到或超过 500 元则八五折优惠;达到或超过 1000 元则八折优惠。请编写程序,根据购物金额计算优惠后的实际付款金额。
输入格式
购物金额
输出格式
付款金额
输入样例1
87.5
输出样例1
87.50
输入样例2
2403.85
输出样例2
1923.08
代码长度限制
16 KB
时间限制
400 ms
内存限制
64 MB
栈限制
8192 KB
#include<stdio.h>
int main()
{
double count=0.0;
scanf("%lf",&count);
if( count < 100.0)
{
printf("%.2lf",count);
}
if(count >= 100 && count<200)
{
printf("%.2lf",count*0.95);
}
else if(count >= 200 && count<500)
{
printf("%.2lf",count*0.9);
}
else if(count >= 500 && count <1000)
{
printf("%.2lf",count*0.85);
}
else if(count >= 1000)
{
printf("%.2lf",count*0.8);
}
return 0;
}