#include
#include
#include
#include
#include
#include
using namespace std;
int main()
{
//set up
const int MAX_WRONG=8;
vector
words.push_back("YES");
srand(static_cast
random_shuffle(words.begin(),words.end());
const string THE_WORD=words[0];
int wrong=0;
string soFar(THE_WORD.size(),'-');
string used=" ";
cout<<"Welcone to Hangman.Good luck!n";
//main loop
while((wrong
cout<<"nnYou hace"<<(MAX_WRONG - wrong);
cout<<"incorrent guesses leftn";
cout<<"您使用以下字母"<
cout<<"输入您的猜测"<
guess=toupper(guess);
while(used.find(guess)!=string::npos)
{
cout<<"您已经猜到了"<
cin>>guess;
guess=toupper(guess);
}
used+=guess;
if(THE_WORD.find(guess)!=string::npos)
{
cout<<"That's right"<
if(THE_WORD[i]==guess)
{
soFar[i]=guess;
}
}
}
else
{
cout<<"Sorry,"<
}
}
//shut down
if(wrong==MAX_WRONG)
{
cout<<"n你是被绞死的"<
else
{
cout<<"n你猜对了"<
cout<<"这个词是"<
}



