现在的位置: 首页 > 综合 > 正文

hdu 2203

2013年01月09日 ⁄ 综合 ⁄ 共 239字 ⁄ 字号 评论关闭

只贴最短代码~偷笑( ⊙ o ⊙ )

#include<iostream>
using namespace std;
char s[200005],p[200005],t[200005];
int main()
{
    while(scanf("%s %s",&s,&p)!=EOF)
    {
        strcpy(t,s);strcat(s,t);
        if(strlen(t)>strlen(p)&&strstr(s,p)!=NULL) cout<<"yes"<<endl;
        else cout<<"no"<<endl;
    }
    return 0;
}

抱歉!评论已关闭.