Run ID:115177
提交时间: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; }