调用库函数
2024-09-02 21:42:09
发布于:江苏
0阅读
0回复
0点赞
#include<bits/stdc++.h>
#define ll long long //防伪标识
#define MAXN 1005
#define maxn 10005
#define MAXM 10000
#define maxm 1000005
using namespace std;
string a;
string b;
string::size_type idx;
string::size_type n;
int main(){
cin >> b;
cin>>a;
idx=a.find(b);
n = b.find(a);
if(idx == string::npos &&n == string::npos)
cout << "No substring";
else if(idx == string::npos)
cout <<a<<" is substring of "<<b;
else
cout <<b<<" is substring of "<<a;
return 0;
}
这里空空如也
有帮助,赞一个