RE求助qp
查看原帖
RE求助qp
1182071
HanZengZhao楼主2024/11/8 20:17
#include<bits/stdc++.h>
using namespace std;
bool ma(string n){
//	string f=n;
	for(int i=0,j=n.size()-1;i<n.size()/2;i++,j--){
		if(n[i]!=n[j]){
			return false;
		}
	}
	return true;
} 
int main(){
	string n; 
	int m;
	cin>>m;
	for(int i=0;i<m;i++){
		cin>>n;
		bool p=true;
		for(int j=2;j<=n.size()-2;j++){
			if(ma(n.substr(0,j))&&ma(n.substr(j,n.size()-j))){
				cout<<"Yes"<<endl;
				p=false;
				break;
			}
		}	
		if(p){
			cout<<"No"<<endl;
		}
	}
	return 0;
}

2024/11/8 20:17
加载中...