在我的代码中存在一个问题,即使我输入“Q”或“q”,程序也会不断循环菜单。这里有什么问题?这是代码:
{
char selection;
do {
cout << "Add a county election file A" << endl;
cout << "Show election totals on screen P" << endl;
cout << "Search for county results S" << endl;
cout << "Exit the program Q" << endl;
cout << "Please enter your choice: ";
cin >> selection;
} while ((selection != 'Q' || selection != 'q'));
return 0;
}