0
已解决
董宇昊
初级启示者
初级启示者
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int f[1000]; //f[i]表示下标为i的字符连续重复长度
int main() {
int n;
string s1, s2;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> s1 >> s2;
}
for (int i = 1; i <= n; i++) {
if (s1 == "First" && s2 == "Second" || s1 == "Second" && s2 == "Third" || s1 == "Third" && s2 == "First") {
cout << "T"<<endl;
}
if (s1 == "Second" && s2 == "First" || s1 == "Third" && s2 == "Second" || s1 == "First" && s2 == "Third") {
cout << "Q"<<endl;
}
else {
cout << "P"<<endl;
}
}
return 0;
}