HDU 2203 亲和串【字符串函数的使用】

来源:互联网 发布:阿里云产品主要优势 编辑:程序博客网 时间:2024/06/07 02:36


http://acm.hdu.edu.cn/showproblem.php?pid=2203



#include<stdio.h>#include<string.h>#define MAXN 100000char 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");elseprintf("no\n");}return 0;} 


0 0
原创粉丝点击