本文共 362 字,大约阅读时间需要 1 分钟。
就是用两个函数就搞定了:
#include#include #include using namespace std;char st[100005];char st1[100005];char st2[200005];int main(){ while(cin>>st1>>st2) { strcpy(st,st1);//先复制 strcat(st,st1);//然后接上 if(strstr(st,st2) == NULL)//再找 puts("no"); else puts("yes"); } return 0;}
转载地址:http://ghvol.baihongyu.com/