题意:蛮水的一道题,只要看串a的字符是否依次出现过串b就行了
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int MAXN = 100005;
char a[MAXN],b[MAXN];
int main()
{
while (cin>>a>>b)
{
int cur = 0;
int len_a = strlen(a),len_b = strlen(b);
for (int i = 0; i < len_b; i++)
{
if (cur == len_a)
break;
else if (a[cur] == b[i])
cur++;
}
if (cur == len_a)
cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}