Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
40494 lnx 验证子串 C++ 解答错误 0 MS 248 KB 491 2024-02-10 22:38:43

Tests(0/3):


#include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<string> using namespace std; int main() { char s1[200],s2[200]; cin>>s1>>s2; int len1=strlen(s1); int len2=strlen(s2); char *ret ; if (len1>=len2) { ret=strstr(s1,s2); if(ret!="NULL") cout<<s2<<" is substring of "<<s1; } else { ret=strstr(s2,s1); if(ret!="NULL") cout<<s1<<" is substring of "<<s2; } if (!ret){ cout<<"No substring"; } }


测评信息: