#include<bits/stdc++.h>
using namespace std;
int fun(string s,string t)
{
int len=s.length();
while(len--)
{
if(s.find(t)!=string::npos)
return 1;
s.push_back(s[0]);
s.erase(s.begin());
}
return 0;
}
int main()
{
string a,b;
cin>>a>>b;
if(fun(a,b)||fun(b,a)) cout<<"true";
else cout<<"false";
}
字符串移位包含问题
最新推荐文章于 2022-07-22 13:09:56 发布