Simple if/else if/else statement not working

For some reason, the output is always "You answered 1. You will now die." No matter what you input, it always gives the same answer?
Thanks!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

 #include <iostream>
using namespace std;

int main()

{

cout << "Your options are 1-5. Good luck." << endl;

string userinput;

{

cin >> userinput;

 if (userinput == "1", "one", "One") cout << "You answered 1. You will now die." << endl;

 else if (userinput == "2", "two", "Two") cout << "You answered 2. You will now die." << endl;

 else if (userinput == "3", "three", "Three") cout << "You answered 3. You will now die." << endl;

 else if (userinput == "4", "four", "Four") cout << "You answered 4. You will now die." << endl;

 else if (userinput == "5", "five", "Five") cout << "You answered 5. You will live." << endl;

 else cout << "You should have followed the rules. You will now die." << endl;

}


}
You need to use the logical OR operator: ||

 
if (userinput == "1" || userinput ==  "one" || userinput == "One")
Thank you! It worked flawlessly.
Topic archived. No new replies allowed.