hdu 2203

时间:2023-03-09 02:59:42
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;
}