1 條題解
-
0
#include<bits/stdc++.h> using namespace std; string s1,s2; int n=0; int main(){ cin>>s1>>s2; int len1 = s1.size(),len2 = s2.size(); if(len1>=len2) if(s1.find(s2)!=-1) n=1; else if(s2.find(s1)!=-1) n=2; if(n==1) cout<<s2+" is substring of "+s1; else if(n==2) cout<<s1+" is substring of "+s2; else cout<<"No substring"; return 0; }
- 1
資訊
- ID
- 345
- 時間
- 1000ms
- 記憶體
- 128MiB
- 難度
- 10
- 標籤
- 遞交數
- 3
- 已透過
- 3
- 上傳者