hdu 2203 亲和串

来源:互联网 发布:华为mate9数据恢复 编辑:程序博客网 时间:2024/06/10 04:43
//strstr(a, b)在a中寻找相同序列的字串,存在返回指针,否则返回Null//strstr(a, b)-a+1表示第几位出现相同序列#include<iostream>#define Max 100005using namespace std;char a[100002], b[100002], c[200004];int main(){while(gets(a) != NULL){strcpy(c, a);strcat(c, a);gets(b);if(strstr(c, b))printf("yes\n");elseprintf("no\n");}return 0;}

原创粉丝点击