Run ID:136077
提交时间:2025-11-09 12:20:07
#include <bits/stdc++.h> using namespace std; int main() { int i,j,k,n,s,t,temp; string a; cin>>t; n=0; while (n<t) { cin>>a; s=a.size(); i=0; temp=1; k=a.size()-1; while (i<a.size()/2) { if (a[i]==a[k]) { i++; k--; } else { temp=0; break; } if (temp!=0) s++; } cout<<s<<endl; n++; } return 0; }