https://www.acgo.cn/
2025-07-14 21:41:53
发布于:四川
5阅读
0回复
0点赞
#include <iostream>
#include <string>
int main() {
stdios_basesync_with_stdio(false);
std::cin.tie(NULL);
std::string s1, s2;
std::cin >> s1 >> s2;
bool found = false;
if (s1.length() >= s2.length()) {
std::string s1_doubled = s1 + s1;
if (s1_doubled.find(s2) != std::string::npos) {
found = true;
}
}
if (!found && s2.length() >= s1.length()) {
std::string s2_doubled = s2 + s2;
if (s2_doubled.find(s1) != std::string::npos) {
found = true;
}
}
if (found) {
std::cout << "true\n";
} else {
std::cout << "false\n";
}
return 0;
}
全部评论 1
哈哈哈
2025-07-14 来自 四川
1哈哈哈
2025-07-14 来自 四川
1哈哈哈
2025-07-14 来自 四川
1
有帮助,赞一个