網頁

2014年2月14日 星期五

UVA 10340 - All in All

 #include <iostream>
 #include <cstdio>
 #include <cmath>
 #include <vector>
 #include <string>
 #include <sstream>
 #include <algorithm>
 #include <map>
 #include <bitset>
 #define MAX 1000000
 using namespace std;
 typedef long long int lli;
 
 int main(int argc, char *argv[]){
   string s, t;
   int i, j;
   while (cin >> s >> t){
     i=0, j=0;
     while (i!=t.length()){
       if (s[j]==t[i]) ++j;
       ++i;
     }
     cout << (j==s.length() ? "Yes" : "No") << endl;
   }
   return 0;
 }

沒有留言:

張貼留言