#55597: c++解答


yp11451009@yphs.tp.edu.tw (711-19王敬皓)


c++

 

#include<bits/stdc++.h>
using namespace std;
int main(){
    string t;
    char n;
    while(cin>>t>>n){
        string s="";
        for(int i=0;i<t.size();i++){
            if(t[i]!=n) s+=t[i];
        }
        bool ok=1;
        for(int i=0;i<s.size()/2;i++){
            if(s[i]!=s[s.size()-1-i]){
                ok=0;
                break;
            }
        }
        if(ok) cout<<"Yes\n";
        else cout<<"No\n";
    }
}