Untitled
unknown
plain_text
3 years ago
646 B
9
Indexable
#include<bits/stdc++.h>
using namespace std ;
#define int long long
bool palindrome (string s ){
int n =s.length();
int i=0;
while(i<n/2){
if(s[i]!=s[n-1-i])
return false ;
}
return true ;
}
int32_t main(){
int n ;
cin>>n ;
vector<string>v(n);
for(int i=0;i<n ;i++){
string s ;
cin>>s ;
v[i]=s;
}
for(int i=0;i<n ;i++){
for(int j=0;j<n ;j++){
if(i==j)continue;
string temp= v[i]+v[j];
if(palindrome(temp))cout<<"Yes";
else cout<<"No";
}
}
return 0;
}Editor is loading...