poj 1936 All in All

来源:互联网 发布:电子相册网站源码 编辑:程序博客网 时间:2024/06/07 16:53
#include <iostream>#include <string.h>#include <stdio.h>#define MAXN 60  /* s1在s2中就行  */using namespace std;  int main()  {      int i,j;        char s1[100000],s2[100000];    while(cin>>s1>>s2)    {        int len1=strlen(s1);        int len2=strlen(s2);        i=0;        j=0;        for(j=0;j<len2;j++)        {            if(s1[i]==s2[j])i++;            if(i==len1){printf("Yes\n");break;}        }        if(i<len1)printf("No\n");     memset(s1,'\0',sizeof(s1));        memset(s2,'\0',sizeof(s2));    }      return 0;  }

0 0
原创粉丝点击