额,这个用到啥了?好像只有字符串以'\0'为结尾吧...
code:
#include<cstdio>
char str[100001] ;
char substr[100001] ;
int main(){
int i, j ;
while(~scanf("%s%s", substr, str)){
i = 0, j = 0 ;
while(substr[i]!='\0'&&str[j]!='\0'){
if(substr[i]==str[j])
i ++ ;
j ++ ;
}
if(substr[i]=='\0')
printf("Yes\n") ;
else
printf("No\n") ;
}
char str[100001] ;
char substr[100001] ;
int main(){
int i, j ;
while(~scanf("%s%s", substr, str)){
i = 0, j = 0 ;
while(substr[i]!='\0'&&str[j]!='\0'){
if(substr[i]==str[j])
i ++ ;
j ++ ;
}
if(substr[i]=='\0')
printf("Yes\n") ;
else
printf("No\n") ;
}
}