Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3459 杨洋杰 字符串包含判断 C++ Accepted 0 MS 268 KB 639 2024-06-08 17:10:22

Tests(10/10):


Code:

#include<iostream> #include<cstring> using namespace std; int main(){ string a,b; getline(cin,a); getline(cin,b); int A=a.size(),B=b.size(); for(int i=0;i<A-B;i++){ if(a==b){ cout<<"yes"<<endl; return 0; } else{ bool f=1; for(int j=i,k=0;k<B;j++,k++){ if(a[j]!=b[k]){ f=0; break; } } if(f==1){ cout<<"yes"<<endl; return 0; } } } cout<<"no"<<endl; return 0; }