题目传送门:https://cn.vjudge.net/problem/UVA-10340
简单的字符串题目
AC code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s, t;
while (cin >> s >> t) {
unsigned int i = 0, j = 0;
while (i < s.length() && j < t.length()) {
if (s[i] == t[j]) {
++i;
++j;
} else {
++j;
}
}
cout << (i == s.length() ? "Yes\n" : "No\n");
}
return 0;
}