uva 10340 All in All

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

题意:

输入字符串s和t,问是否能从t中删除0个或多个字符得到s。

思路:

略。。。

代码:

 1 #include <iostream>
 2 #include <string>
 3 using namespace std;
 4 
 5 int main()
 6 {
 7     string a,b;
 8 
 9     while (cin >> a >> b)
10     {
11         int i = 0;
12         int j = 0;
13 
14         while (j < b.length())
15         {
16             if (a[i] == b[j])
17             {
18                 i++;
19                 j++;
20             }
21             else
22                 j++;
23 
24             if (i >= a.length()) break;
25         }
26 
27         if (i == a.length()) cout << "Yes
";
28         else cout << "No
";
29     }
30 
31     return 0;
32 }
原文地址:https://www.cnblogs.com/kickit/p/7921624.html