Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3456 孙浚轩 字符串包含判断 C++ Accepted 0 MS 264 KB 403 2024-06-08 16:58:51

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ string a,b,tempstr; cin>>a>>b; int lenb=b.size(),frequency=a.size()-lenb,temp; for(int i=0;i<=frequency;){ tempstr="",temp=i+lenb; for(;i<temp;i++) tempstr+=a[i]; if(tempstr==b){ cout<<"yes"; return 0; } i-=lenb-1; } cout<<"no"; return 0; }