Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<algorithm>
- #include<string>
- using namespace std;
- int main()
- {
- string str1, str2;
- while (cin >> str1 >> str2)
- {
- bool error;
- int mark = 0;
- for (int i = 0; i < str1.size(); i++)
- {
- error = 1;
- for (int j = mark; j < str2.size(); j++)
- {
- if (str1[i] == str2[j])
- {
- mark = j+1; error = false; break;
- }
- }
- if (error) {
- cout << "No\n";
- break;
- }
- }
- if (!error) cout << "Yes\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement