唐氏板子
本题为唐氏题目,可以将判断条件填入下方
Here处进行判断。
#include<bits/stdc++.h>
using namespace std;
bool solve(){
int n;cin>>n;
while(n--){
string s;cin>>s;
if(/*Here*/){
while(n--)
cin>>s;
return false;
}
}
return true;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr),cout.tie(nullptr);
int T;cin>>T;
while(T--)
cout<<(solve()?"Pinyin\n":"English\n");
return 0;
}唐氏解法 1
由于文本都来自真实、易于人类阅读的文本,所以英语中必定存在大量的 th,故 Here 处填写 s.find("th")!=string::npos。
唐氏解法 2
由于拼音的最大长度为 ,所以若存在某个单词的长度大于 ,那么它一定是英语,故 Here 处填写 s.size()>6。
唐氏解法 3
已知英语单词的末尾基本可以是任何字母,所以在一个字符串 fd 中随便敲几个不可以出现在拼音末尾的字符,则 Here 处填写 fd.find(s.back())!=string::npos。