Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41849 | yuhaoyu | 验证子串 | C++ | Accepted | 0 MS | 252 KB | 412 | 2024-02-23 15:07:05 |
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { char s1[200],s2[200]; gets(s1); gets(s2); if(strstr(s2,s1)) { cout<<s1<<" is substring of "<<s2<<endl; return 0; } if(strstr(s1,s2)) { cout<<s2<<" is substring of "<<s1<<endl; return 0; } cout<<"No substring"<<endl; return 0; }