Uva 10340.All in All

哎~这题没什么要注意的吧。。。注意数组别开太小就行

然后往下比较下去……十分钟就能撸完吧

 1 #include <cstdio>
 2 using namespace std;
 3 
 4 #define REP(n) for(int o=0;o<n;o++)
 5 
 6 bool Do();
 7 
 8 int main(){
 9     //freopen("in.txt","r",stdin);
10     while(Do());
11     return 0;
12 }
13 
14 bool Do(){
15     const int maxn=1000000;
16     char s[maxn];
17     char t[maxn];
18 
19     REP(maxn)
20         s[o]=t[o]='';
21 
22     if(scanf("%s%s",s,t)==EOF)
23         return false;
24 
25     int si=0,ti=0;
26     bool yes=false;
27     while(1){
28         if(s[si]==''){
29             yes=true;
30             break;
31         }
32         if(t[ti]=='')break;
33         if(s[si]==t[ti])si++;
34         ti++;
35     }
36     printf("%s
",yes?"Yes":"No");
37     return true;
38 }
原文地址:https://www.cnblogs.com/ohyee/p/5153033.html