题目描述
不会
样例
#include<iostream>
#include<cstring>
using namespace std;
string s1, s2;
int main()
{
cin >> s1 >> s2;
if(s1.size() >= s2.size()) swap(s1, s2);
if(s1 == s2.substr(0, s1.size()))
{
cout << "true" << endl;
return 0;
}
if(s2.find(s1) != -1)
{
cout << "true" << endl;
return 0;
}
bool flag = false;
for(int i = 0; i < s1.size(); i ++)
{
string a = s2.substr(s2.size() - s1.size() + i);
string b = s2.substr(0, i);
if(a + b == s1) flag = true;
}
if(flag) cout << "true" << endl;
else cout << "false";
return 0;
}