1. 程式人生 > >10340 All in All

10340 All in All

題目傳送門

#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
string str1, str2;
int main(void)
{
	while (cin >> str1 >> str2)
	{
		int p1 = 0;
		int p2 = 0;

		while (p1 < str1.size() && p2 < str2.size())
		{
			if (str1[p1] == str2[p2]) { p1++; p2++; }
			else p2++;
		}
		printf("%s\n", (p1 == str1.size()) ? "Yes" : "No");
	}

	return 0;
}