题解
2023-08-07 17:14:23
发布于:浙江
10阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
string s_1 ,s_2;
cin >> s_1 >> s_2;
if (s_1.find(s_2) != -1) //如果不包含,find函数会返回-1
cout << s_2 << " is substring of " << s_1;
else if (s_2.find(s_1) != -1)
cout << s_1 << " is substring of " << s_2;
else
cout << "No substring";
return 0;
}
这里空空如也
有帮助,赞一个