AcWing 763. 循环相克令
原题链接
简单
作者:
牛奶小柒Luke
,
2021-02-10 16:32:14
,
所有人可见
,
阅读 446
直接打表,不过用size之差也挺好
#include <iostream>
#include <cstring>
using namespace std;
const int N = 110;
int n;
int main(){
string str1,str2;
cin >> n;
while(n--){
cin >> str1 >> str2;
if(str1.size() - str2.size() == 3 || str1.size() - str2.size() == -1 || str1.size() - str2.size() == -2){
cout << "Player1" << endl;
}else if(str1.size() == str2.size()){
cout << "Tie" << endl;
}else{
cout << "Player2" << endl;
}
}
return 0;
}
#include <iostream>
#inlcude <cstring>
using namespace std;
int main (){
int t;
cin>>t;
while(t--){
string a,b;
cin >> a >> b;
if(a == b)puts("Tie");
else if(a == "Hunter "&& b == "Gun" || a == "Bear" && b == "Hunter" || a == "Gun" && b == "Bear")
puts("Player1");
else puts("Player2");
}
return 0;
}