2 条题解

  • 2
    @ 2024-11-24 16:04:18
    #include<bits/stdc++.h>
    using namespace std;
    string a,b;
    int main()
    {
        cin>>a>>b;
        if(a.find(b)!=a.npos)    //如果b是a的子串 
        {
            cout<<b<<" is substring of "<<a<<endl;
        }
        else if(b.find(a)!=b.npos)   //如果a是b的子串 
        {
            cout<<a<<" is substring of "<<b<<endl;
        }
        else      //如果没有子串关系 
        {
            cout<<"No substring"<<endl;
        }
        return 0;
    }
    
    

信息

ID
345
时间
1000ms
内存
128MiB
难度
9
标签
递交数
10
已通过
6
上传者