我的if
陈述相互冲突时遇到问题。这是我的代码:
std::cout << "1) Option 1\n";
std::cout << "2) Option 2\n";
std::cout << "3) Option 3\n";
std::cout << "4) Option 4\n";
std::cout << "Type your choice and hit ENTER \n";
std::cin >> Choice;
if(Choice == 1);
{
std::cout << "Blah Blah\n";
}
if(Choice == 2);
{
std::cout << "Blah Blah\n";
}
if(Choice == 3);
{
std::cout << "Blah Blah\n";
}
if(Choice == 4);
{
std::cout << "Blah Blah\n";
}
我的意思是:它会忽略我的if
语句并运行我的所有代码,这样它就会打印出来:
Blah Blah
Blah Blah
Blah Blah
Blah Blah
我的错误是什么?