Mr. Kitayuta's Gift
Posted NWU_ACM
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mr. Kitayuta's Gift相关的知识,希望对你有一定的参考价值。

1 //回文判断 Codeforces Round #286 (Div. 2) 2 #include<iostream> 3 #include<cstdio> 4 int main() 5 { 6 string f,temp; cin>>f; 7 int len(f.size()); 8 for(char c =‘a‘;c<=‘z‘;c++) 9 { 10 temp.clear(); 11 temp.push_back(c); 12 for(int i=0;i<=len;i++) 13 { 14 string spre = f.substr(0,i); 15 string stail = f.substr(i,len-i); 16 string s1 = spre + temp + stail; 17 string s2 = s1; 18 reverse(s2.begin(),s2.end()); //翻转字符串 19 if(s1 == s2) {cout<<s1<<endl;return 0;} 20 } 21 } 22 printf("NA\n"); 23 return 0; 24 }
以上是关于Mr. Kitayuta's Gift的主要内容,如果未能解决你的问题,请参考以下文章