zoj 1970 why Wrong Answer?
#include <stdio.h>
main()
{
char s[1000005],t[1000005];
unsigned int i,j,num;
while(scanf( "%s %s ",s,t)!=EOF)
{
i=0;
j=0;
num=0;
while(s[i]!= '\0 '&&t[j]!= '\0 ')
{
for(j=j;t[j]!= '\0 ';j++)
if(s[i]==t[j])
{
num++;
break;
}
i++;
}
if(num==i)
printf( "Yes\n ");
else
printf( "No\n ");
}
}
[解决办法]
if(s[i]==t[j])
{
num++;
j++; //你的代码这里似乎需要j加1;
break;
}