求救,50分
查看原帖
求救,50分
1702309
wyz20041108楼主2025/7/26 17:38
#include<bits/stdc++.h>
using namespace std;
bool x(string s , string b , int i , int j){
      if(s[i] == b[j]){
            return true;
      }
}
string s , b;
int n , cnt = 1;
int main(){
      cin >> n >> s >> b;
      for(int i = 1;i <= n;i++){
            if(x(s,b,cnt,i)){
                  cnt++;
            }
      }
      if(n == cnt){
            cout << "Yes";
      }else{                                                         
            cout << "No";
      }
      return 0;
}
2025/7/26 17:38
加载中...