题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2203
题意:
中文题,意思很清楚。
方法貌似有好多种。
参考代码:
#include <stdio.h>
#include <string.h>
int main()
{
char a[100001],b[100001],t[100001];
while(gets(a))
{
gets(b);
strcpy(t,a);//将a串复制到空串t
strcat(t,a);//这句话加上前一句的意思是加倍a串,比如a串原来是1234,加倍后是12341234的意思。
if(strstr(t,b)!=NULL)
puts("yes");
else
puts("no");
}
return 0;
}