#include <iostream>
#include <string>
using namespace std;
int main()
{
string option;
cout << "Would like water, beer, or rum?--> ";
cin >> option;
while( option != "water" || option != "beer" || option != "rum" )
{
cout << "You did not choose a valid option. Try again.\n";
cout << "Would you like water, beer, or rum?-->";
cin >> option;
}
}
为什么即使用户输入了正确的选项,这段代码也不会退出循环?