10340 - All in All

2014-11-24 07:22:03 · 作者: · 浏览: 4
[cpp]
描述:从t字符串中查找s字符串,查到,就输出Yes,否则,输出No
#include
#include
#include
char s[10010],t[1000010];
int main()
{
//freopen("a.txt","r",stdin);
while(scanf("%s%s",s,t)!=EOF)
{
int len_s=strlen(s),len_t=strlen(t),count=0;
for(int i=0; i
if(count
{
if(t[i]==s[count]) count++;
}
else break;
if(count==len_s) printf("Yes\n");
else printf("No\n");
}
return 0;
}