求调喵
查看原帖
求调喵
952846
Happiness_Python楼主2025/6/28 19:37
#include <bits/stdc++.h>
using namespace std;

int if_huiwen(string s)
{
	int k = s.size() / 2;
	for (int i=0, j=s.size()-1; i<s.size(), j>=s.size()-k; i++, j--)
	{
		if (!(s[i] == s[j]))
			return 0;
	}
	return 1;
}

int main()
{
	int a;
	cin >> a;
	for (int i=1; i<=a; i++)
	{
		string s1;
		char c;
		int f=0;
		while (cin >> c)
		{
			s1 += c;
			if (if_huiwen(s1))
			{
				s1 = "";
				f = 1;
			}
		}
		if (f == 0)
			cout << "No" << endl; 
		else
			cout << "Yes" << endl;
	}
	return 0;
}
2025/6/28 19:37
加载中...