C语言问题求大神请教 某商店推出打折活动,要求购物达到或超过2000元得打八折,购物达到或超过5

C语言问题求大神请教
某商店推出打折活动,要求购物达到或超过2000元得打八折,购物达到或超过500元不到1000的减50元,购物不到500元的原价,请写出相应的程序(分别用switch和if-else结构)

int ShoudPay(int value)
{
if(value < 500)
return value;
else if(value >=500 && value < 2000)
return value - 50;
else
return (int )(value * 0.8f);
}
原文没有提到 1000 - 2000,不科学。不可能500 - 1000的都减价,1000 - 2000的不减,
当然 如果你是做题 的话 请严格按照题意追问

就这些吗😭😭看不懂

追答

.....那我不知道该怎么办了····

温馨提示:答案为网友推荐,仅供参考