abc a 123456 45 abc ddd
YES YES NO
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#include<stdio.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int q,w;
while(scanf("%s%s",&a,&b)!=EOF)
{
for(w=0,q=0;a[w]!=‘\0‘ && b[q]!=‘\0‘;)
{
if(a[w]==b[q])
{
q++;
w++;
}
else
w++;
}
if(q==strlen(b) && w<=strlen(a))
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
原文:http://www.cnblogs.com/jiangweibo/p/3543426.html