#include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
long ts;
cin>>ts;
while(ts--)
{
string s2,s1;
cin>>s1;
long l2,l1,i,cnt=0,i1,flag=0,k,i2;
long n;
l1=s1.size();
cin>>n;
for(i=1;i<=n;i++)
{
cin>>s2;
l2=s2.size();
for(i1=0;i1<l1;i1++)
{
cnt=0;
if(s1[i1]==s2[0])
{
flag=1;
k=i1+1;
for(i2=1;i2<l2;i2++)
{
if(s1[k++]==s2[i2])
{
cnt++;
}
else
break;
}
goto check;
}
}
check:
if(flag==1)
{
if(cnt==(l2-1))
{
cout<<"y"<<endl;
}
else
cout<<"n"<<endl;
}
else
cout<<"n"<<endl;
}
}
}
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
long ts;
cin>>ts;
while(ts--)
{
string s2,s1;
cin>>s1;
long l2,l1,i,cnt=0,i1,flag=0,k,i2;
long n;
l1=s1.size();
cin>>n;
for(i=1;i<=n;i++)
{
cin>>s2;
l2=s2.size();
for(i1=0;i1<l1;i1++)
{
cnt=0;
if(s1[i1]==s2[0])
{
flag=1;
k=i1+1;
for(i2=1;i2<l2;i2++)
{
if(s1[k++]==s2[i2])
{
cnt++;
}
else
break;
}
goto check;
}
}
check:
if(flag==1)
{
if(cnt==(l2-1))
{
cout<<"y"<<endl;
}
else
cout<<"n"<<endl;
}
else
cout<<"n"<<endl;
}
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন