文章
23
粉丝
234
获赞
43
访问
175.8k
#include <stdio.h>
int main() {
float discount, pay, cost;
scanf("%f", &cost);
if(cost >= 5000) {
discount = 0.8;
pay = cost*discount;
printf("discount=%.1f,", discount);
}
else if(cost >= 3000 && cost < 5000) {
discount = 0.85;
pay = cost*discount;
printf("discount=%.2f,", discount);
}
else if(cost >= 2000 && cost < 3000) {
discount = 0.9;
pay = cost*discount;
printf("discount=%.1...
登录后发布评论
暂无评论,来抢沙发