#include <iostream>
usingnamespace std;
int main ()
{
string i;
char response;
cout << "Hello. What is your name?\n";
cin >> i;
cout << i << " is a horrble name.\n";
cout << "How many friends do you have?\n";
cin >> i;
cout << i << "? That seems like an abnormally small amount.\n";
cout << "Have you ever contemplated suicide?\n";
cin >> response;
if (response == 'y' or 'Y')
{
cout << "Well maybe you should go through with it.\n";
system("pause");
}
elseif (response == 'n' or 'N')
{
cout << "Well maybe you should reconsider.\n";
system("pause");
}
{
cout << "Do you want to play a game?\n";
cin >> response;
if (response == 'y' or 'Y')
{
cout << "Okay, here are the rules:\n";
system("pause");
cout << "Rule 1: You are a horrible person.\n";
system("pause");
cout << "Rule 2: You lose.";
system("pause");
cout << "Goodbye.\n";
}
elseif (response == 'n' or 'N')
{
cout << "Well you suck, and you would have lost anyways.\n";
system("pause");
cout << "Goodbye \n";
}
}
system("pause");
return 0;
}
After the "Do you want to play a game?", when I run the program, it doesn't let me type in an answer, it just skips to the "Okay here are the rules" in the if (response == 'y' or 'Y') area. What am I doing wrong?