Warum gibt dies nur "Ja" zurück

int OnLoad() {
cout << "Hi whats your name? ";
cin >> name;
system("cls");
cout << "Hi " << name << "." << " Are you here to Take Over the city from zombies?"<< endl;
cin >> userInput;
if (userInput == "yes" || "Yes") {
    cout << "Yes" << endl;
}
else if (userInput == "no" || "No") {
    cout << "No" << endl;
}
else {
    cout << "I don't understand." << endl;
}
return 0;
}

int main() {
OnLoad();
system("pause");
return 0;
}

Dieser Code gibt nur "Ja" zurück, nachdem das Konsolenfenster geöffnet wurde und Sie gefragt werden, ob Sie die Stadt von Zombies übernehmen möchten, auch wenn ich "Nein" eingebe. Er gibt "Ja" zurück!

Antworten auf die Frage(4)

Ihre Antwort auf die Frage