gogogoohleohleohle
2023-12-30 13:26:47
发布于:广东
33阅读
0回复
0点赞
#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
const int maxn = 100005;
int main(){
char buf[maxn], ch[maxn], ans[maxn];
while(scanf("%s%s", buf, ch) != EOF){
memset(ans, 0, sizeof ans);
int len_buf = strlen(buf);
int len_ch = strlen(ch);
int index = 0;
for(int i = 0; i < len_ch; i++){
if(ch[i] == buf[index]){
ans[index] = ch[i];
index++;
}
}
bool flag = true;
for(int i = 0; i < len_buf; i++){
if(ans[i] != buf[i]){
flag = false;
break;
}
}
if(flag == true){
printf("Yes\n");
}else{
printf("No\n");
}
}
return 0;
}
这里空空如也
有帮助,赞一个