hdu 2203

题意: 子串问题

水题,只要把母串*2,然后比较......

感觉我好懒....没有自己写函数......

反正我不是勤快的人.........

 

AC代码:

#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;
int main()
{
    char a[100010],b[100010],c[100010];
    while(gets(a)){
    gets(b);
    strcpy(c,a);
    strcat(c,a);
    if(strstr(c,b)!=NULL)
        cout<<"yes\n";
    else
        cout<<"no\n";}
    return 0;
}

posted @ 2014-12-06 11:05  __夜风  阅读(113)  评论(0编辑  收藏  举报