#include <iostream.h> #include <string.h> #include <fstream.h> ifstream f("all.in"); #define cin f int main() { char a[10000],b[10000]; while(cin>>a>>b) { int flag=0; int pos1=strlen(a)-1; int pos2=strlen(b)-1; while(1) { if(a[pos1]==b[pos2]) { pos1--; pos2--; } else pos2--; if (pos1<0) {flag=0;break;} if (pos2<0 && pos1>=0) {flag=1;break;} } if(flag) cout<<"No"<<endl; else cout<<"Yes"<<endl; } }

评论