mardi 26 septembre 2017

Issue with and if statement containing a string in c++

#include <iostream>

using namespace std;

int main(){

    cout << endl;
    cout << "Welcome to the wonderful world of a spy" << endl;
    cout << "Today we are to decode some information that has been provided." <<endl;
    string response;
    cout << "Are you ready?" << endl;
    cin >> response;
    if (response == "yes", "y", "Yes", "Y"){
        cout << "Alright, let's go!!!" << endl;
    }
    else {
        cout << "Well, too bad. We are going to do it anyways." << endl;
    }
}

Exact Code Here is my code thus far. I can't get it to not say "Alright, let's go!!! What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire