Skip to main content
Code Review

Return to Question

Tweeted twitter.com/#!/StackCodeReview/status/418602305727234048
added 130 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
#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;
}
edited tags
Link
amon
  • 12.7k
  • 37
  • 67
Source Link

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

AltStyle によって変換されたページ (->オリジナル) /