#include "stdafx.h"
#include <iostream>
using namespace std;
int main ()
{
for (int i = 0; i <= 3; i++) //give the user 4 guesses at the word.
{
std::string guess;
cout <<"Guess<<"Guess the word"word" <<endl;
cin >>guess;
if (guess == "Dog""Dog")
{
cout <<"You<<"You guessed correctly. "" <<endl;
break;
}
else
{
cout <<"You<<"You guessed incorrectly. "" <<endl;
}
}
char f;
cin >>f;
return 0;
}
#include "stdafx.h"
#include <iostream>
using namespace std;
int main ()
{
for (int i = 0; i <= 3; i++) //give the user 4 guesses at the word.
{
std::string guess;
cout <<"Guess the word" <<endl;
cin >>guess;
if (guess == "Dog")
{
cout <<"You guessed correctly. " <<endl;
break;
}
else
{
cout <<"You guessed incorrectly. " <<endl;
}
}
char f;
cin >>f;
return 0;
}
#include "stdafx.h"
#include <iostream>
using namespace std;
int main ()
{
for (int i = 0; i <= 3; i++) //give the user 4 guesses at the word.
{
std::string guess;
cout <<"Guess the word" <<endl;
cin >>guess;
if (guess == "Dog")
{
cout <<"You guessed correctly. " <<endl;
break;
}
else
{
cout <<"You guessed incorrectly. " <<endl;
}
}
char f;
cin >>f;
return 0;
}
Char string review
#include "stdafx.h"
#include <iostream>
using namespace std;
int main ()
{
for (int i = 0; i <= 3; i++) //give the user 4 guesses at the word.
{
std::string guess;
cout <<"Guess the word" <<endl;
cin >>guess;
if (guess == "Dog")
{
cout <<"You guessed correctly. " <<endl;
break;
}
else
{
cout <<"You guessed incorrectly. " <<endl;
}
}
char f;
cin >>f;
return 0;
}
lang-cpp