您的位置:首页 > 其它

UVa 10340:All in All(字符串)

2017-04-18 16:07 363 查看
题目传送门: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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: