11,799
社区成员




商品优惠计算器
使用if语句编程实现输入购货金额,输出实际付款金额。购货折扣率如下:
购货金额≤500元 不打折
500元<购货金额≤1000元 9折
1000元<购货金额 8折
以下程序实现了这一功能,请你补全空白处内容:
#include <stdio.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main()
{
float money = 0.0;
float pay = 0.0;
bool run = true;
while (run)
{
printf("\n请输入购货金额:\n");
scanf("%f", &money);
____________________;
}
return 0;
}