Uva.10340 All in All

来源:互联网 发布:淘宝最帅男模特顾义伟 编辑:程序博客网 时间:2024/06/10 08:55

#include<iostream>#include<cstdio>#include<string>using namespace std;const int maxn = 10000;int main() {//freopen("Text.txt", "r", stdin);string s, t;while (cin >> s >> t) {int i=0, j = 0;while (j < t.size()) {if (s[i] == t[j]) {i++;j++;}elset=t.erase(j,1);//删除从j开始的1个字符//cout << t << endl;//cout << j << endl;}//cout << s << " " << t << endl;if (s == t)cout << "Yes" << endl;elsecout << "No" << endl;}return 0;}

题目链接:

https://vjudge.net/problem/UVA-10340




原创粉丝点击