跳到正文

题解

题解:B3759 [信息与未来 2021] 文本分类

easy42约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年3月10日
收录
2025年12月12日
更新
2026年11月21日
篇幅
约 1 分钟
获赞
2
题目
B3759

版本

  1. v1当前

English.

让我们挖掘直觉。

拼音中没有 th,但英语中却很常见,如 th these 等。

直接判断即可。

代码:

使用了 getline 和 find 函数,代码极短。

C++
#include<bits/stdc++.h>
using namespace std;
int t,n;
string s;
int main(){
	cin>>t;
	while(t--){
		cin>>n;
		getline(cin,s);
		if(int(s.find("th"))!=-1) cout<<"English\n";
		else cout<<"Pinyin\n";
	}
	return 0;
}
原文