UVa 10340:All in All(字符串)

题目传送门: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;
}
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页