http://acm.hdu.edu.cn/showproblem.php?pid=2203
#include<stdio.h>
#include<string.h>
#define MAXN 100000
char a[MAXN],b[MAXN],c[MAXN];
int main()
{
while(~scanf("%s",a))
{
scanf("%s",b);
strcpy(c,a);
strcat(a,c);
if(strstr(a,b))
printf("yes\n");
else
printf("no\n");
}
return 0;
}