坑.51nod-1347 旋转字符串

来源:互联网 发布:sftp自定义端口号 编辑:程序博客网 时间:2024/05/18 13:47

任你如何旋转。。这题也不改变最初的对称性质。

判断原始就行..

#include <iostream>#include <stdio.h>#include <cstring>using namespace std;char s[10000100];int main(){    gets(s);    int flag=0;    for(int i=0,j=strlen(s)/2;j<strlen(s);i++,j++)    {        if(s[i]!=s[j])        {            flag=1;            break;        }    }    if(!flag)        cout<<"YES"<<endl;    else        cout<<"NO"<<endl;    return 0;}


0 0
原创粉丝点击