Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
122405 | 吴诗涵 | 字符串包含判断 | C++ | Accepted | 1 MS | 276 KB | 644 | 2025-06-15 19:29:29 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string a,b; int a_len,b_len,s=0; cin>>a>>b; a_len=a.size(); b_len=b.size(); for(int i=0;i<=a_len-b_len;i++){ s=0; for(int j=i;j<a_len;j++){ if(a[j]==b[s]){ s++; if(s==b_len){ cout<<"yes"; return 0; } } else{ break; } } } cout<<"no"; return 0; }