#include<iostream>
#include<string>
using namespace std;
string input(){
cout << "请输入一个英文字符串" << endl;
string s1, s2;
cin >> s1;
s1 = s1 + s1;
return s1;
}
bool fun()
{
string s = input();
cout << "请输入待检测的字符串" << endl;
string s2;
cin >> s2;
if (s.find(s2) != string::npos)
return true;
else
return false;
}
int main()
{
if (fun())
cout << "是循环移位后的子串" << endl;
else
cout << "ERROR" << endl;
}
字符串循环包含
最新推荐文章于 2024-11-03 23:27:06 发布