Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3469 莫业祁 字符串包含判断 C++ Accepted 0 MS 264 KB 516 2024-06-08 17:17:46

Tests(10/10):


Code:

# include<iostream> # include<cstring> using namespace std; int main(){ string s1,s2; string s3; cin>>s1>>s2; int n=s2.size(); for(int i=0;i<s1.size()-n;i++){ for(int j=i,k=0;j<=i+n,k<n;j++,k++){ if(s1[j]!=s2[k]){ break; } if(k==n-1&&s1[j]==s2[k]){ cout<<"yes"<<endl; return 0; } } } cout<<"no"<<endl; return 0; }