AABCD CDAA ASD ASDF
yes no
//纯字符串函数应有,没什么好说的
#include <stdio.h> #include <string.h> #define N 100010 int main() { char a[N]; char b[N]; char c[N]; 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; }
原文:http://blog.csdn.net/holyang_1013197377/article/details/44587353