题目链接:http://poj.org/problem?id=1936
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std;
const int INF=0x3f3f3f3f;
const int maxn=100010;
char s[maxn],t[maxn];
int main(){
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
freopen("test.out","w",stdout);
#endif
while(~scanf("%s%s",s,t)){
int lens=strlen(s);
int lent=strlen(t);
if(lens>lent){
printf("No\n");
continue;
}
int cnt=0;
for(int i=0;i<lens;i++){
for(int j=0;j<lent;j++){
if(s[i]==t[j]){
cnt++;
i++;
}
}
}
if(cnt==lens)
printf("Yes\n");
else
printf("No\n");
}
return 0;
}