UVA - 10340 All in All

题目链接:UVA - 10340 All in All

      为了获得良好的看书体验,还是做一下好。给定两个序列s,t,问你s是否是t的子序列。

# include 
# include 
# include 
# include 
# include 
using namespace std;
  
const int size = 1000000 + 30; 
 
char s[size],t[size];
int main()
{
	while (scanf("%s%s",s,t)!=EOF)
	{
		int i,j;
		for (i=j=0;t[i]!='\0';i++)
		{
			if (s[j]==t[i])
				j++;
		}
		if (s[j]=='\0')
			printf("Yes\n");
		else 
			printf("No\n");
	}
    return 0;
}


你可能感兴趣的:(Baymax,水题)