#include <iostream>
int main() {
std::cout << "Hello World!\n";
int num,p;
std::cout<<"输入消费金额";
std::cin>>num;
if(num>=1000&&num<2000)
p=num*0.95;
else if(num>=2000&&num<3000)
p=num*0.9;
else if(num>=3000&&num<5000)
p=num*0.85;
else if(num>5000)
p=num*0.8;
else
{
std::cout<<"木有折扣"<<std::endl
<<"优惠后应该付"<<num<<std::endl;
}
}
当输不到2000时正常,超过不能运行?