#include<iostream>
#include<string>
using namespace std;
int main()
{
int a = 0, ans = 0;
string s1, s2;
getline(cin, s1);
getline(cin, s2);
if (s1.length() <= s2.length())
{
for (int i = 0; i <= s2.length() - s1.length(); i++)
{
a = 0;
for (int j = 0; j < s1.length(); j++)
{
if (s2[i + j] != s1[j])
{
a = 1;
break;
}
}
if (a == 0)
{
ans = 1;
break;
}
}
}
if (ans == 1)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}
沒有留言:
張貼留言