tj勿复制
2024-10-19 15:02:20
发布于:江苏
1阅读
0回复
0点赞
#include <iostream> //勿抄
#include <string>
using namespace std;//勿抄
int main() {//勿抄
string firstString, secondString;
// 读取输入
cin >> firstString
cin >> secondString;//勿抄
// 查找子串
if (firstString.find(secondString) != string::npos) {
cout << secondString << " is substring of " << firstString << endl;//勿抄
} else if (secondString.find(firstString) != string::npos) {
cout << firstString << is substring of " << secondString << endl;
} else {//勿抄
cout << "No substring" << endl;//勿抄
}
return 0;//勿抄
}
这里空空如也
有帮助,赞一个