UVA 489

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
int flag,flag2;
string sa;
int find(char a)
{
    int flag1=0;
    for(int i=0;i<sa.length();i++)
    {
        if(sa[i]==a)
        {
            sa[i]='*';
            flag1++;
            flag2--;
        }
    }
    return flag1;
}
int main()
{
    int n,i;
    string sb;
    while(scanf("%d",&n)!=EOF)
    {
        if(n==-1)
            break;
        cin>>sa;
        getchar();
        cin>>sb;
        getchar();
        cout<<"Round "<<n<<endl;
        flag2=sa.length();
        flag=0;
        for(i=0;i<sb.length();i++)
        {
            if(flag==7||flag2==0)break;
            if(find(sb[i])==0)
                flag++;        
        }
        if(flag<=7&&flag2==0)
        {
            cout<<"You win."<<endl;
        }
        else if(flag==7&&flag2!=0)
        {
            cout<<"You lose."<<endl;
        }
        else
        {
            cout<<"You chickened out."<<endl;
        }
        sa="";
        sb="";
        flag=0;
    }
    return 0;
}

 

posted @ 2012-04-28 12:28  open your eyes  阅读(288)  评论(0编辑  收藏  举报