[关闭]
@inkysakura 2017-04-27T10:40:47.000000Z 字数 475 阅读 1294

lightoj1020

CODE


#include <iostream>
#include <cstring>
int nCase;
#define CL(a,b) memset(a,b,sizeof(a))
using namespace std;
const int inf = 0x3f3f3f3f;



int main()
{
        int t;
        cin >> t;
        while(t--)
        {
                int f=0;
                int n;
                char s1[100];
                char *s[2];
                cin >> n>> s1;
                if(s1[0]=='A')
                {
                        f=1;
                        s[0]="Alice";
                        s[1]="Bob";
                }
                else
                {
                        s[0]="Bob";
                        s[1]="Alice";
                }
                cout <<"Case "<<++nCase<<": ";
                if(n==1)
                {
                        cout << s[0^f]<<endl;
                        continue;
                }
                if(f)
                {
                        if((n-1)%3==0)
                                cout << s[1]<<endl;
                        else    cout << s[0]<<endl;
                }
                else
                {
                        if(n%3==0)
                                cout << s[1]<<endl;
                        else    cout << s[0]<<endl;
                }
        }

        return 0;
}
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注