AcWing 763. 循环相克令
原题链接
简单
作者:
Yik-.
,
2023-09-27 20:11:18
,
所有人可见
,
阅读 23
C++ 代码
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
string s1,s2,s3;
s1 = "Hunter";
s2 = "Bear";
s3 = "Gun";
int t;
string a,b;
cin >> t;
while(t--)
{
int x,y;
cin >> a >> b;
if(a == s1)
x = 0;
else if( a == s2)
x = 1;
else
x = 2;
if(b == s1)
y = 0;
else if( b == s2)
y = 1;
else
y = 2;
if(x == y)
puts("Tie");
else if(x == (y + 1) % 3)
puts("Player1") ;
else
puts("Player2");
}
return 0;
}