语法有错误
# include <stdio.h># define RATE1 = 1.0f
# define RATE2 = 0.9f
# define RATE3 = 0.8f
int main(void)
{
int num;
float money, price;
printf("请输入物品数量:");
scanf("%d", &num);
printf("请输入价格:");
scanf("%d", &price);
if(num < 10)
money = price * num * RATE1;
else if(num >= 10)
money = price * num * RATE2;
else(num >= 100)
money = price * num * RATE3;
printf("总价 %f\n", money);
return 0;
}
vc6.0中提示money = price * num * RATE1;有错误,应该怎么改?