#include <bits/stdc++.h>
using namespace std;
string s,s1;
int W,Le;
int f,cas;
void guess(char c)
{
int t=1;
for(int i=0; i<s.length(); i++)
{
if(s[i]==c)
{
f--;
s[i]=' ';
t=0;
}
}
if(t==1)
{
cas--;
}
if(cas==0)
{
Le=1;
}
if(!f)W=1;
}
int main()
{
int ans;
while(cin>>ans>>s>>s1&&ans!=-1)
{
cout<<"Round "<<ans<<endl;
Le =0;
W=0;
f=s.length();
cas=7;
for(int i=0; i<s1.length(); i++)
{
guess(s1[i]);
if(W||Le)break;
}
if(W)cout<<"You win."<<endl;
else if(Le)cout<<"You lose."<<endl;
else cout<<"You chickened out."<<endl;
}
}
UVA - 489 Hangman Judge
最新推荐文章于 2019-05-11 10:48:29 发布