Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
115177 | 吴梓玄 | 字符串包含判断 | C++ | Accepted | 1 MS | 276 KB | 538 | 2025-03-29 17:04:56 |
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 5; char s1[N], s2[N]; int main() { cin >> s1 >> s2; int l1 = strlen(s1), l2 = strlen(s2); if(l1 < l2) cout << "no" << endl; else { //s2 -> s1 int f; for(int i = 0; i + l2 < l1; ++i) { f = 1; for(int j = 0; j < l2; ++j) { if(s1[i + j] != s2[j]) { f = 0; break; } } if(f == 1) break; } if(f == 1) cout << "yes" << endl; else cout << "no" << endl; } return 0; }