#include <iostream>
using namespace std;
int sterge_cifra(int n,int c){
int x=0;
if(n==0){
x=0;
} else{
if(n%10!=c){
x=x+n%10+10*sterge_cifra(n/10,c);
}
else{
x=x+sterge_cifra(n/10,c);
}
}
return x;
}
int main(){
int n,c;
cout<<"Introduceti numarul: ";
cin>>n;
cout<<"Introduceti cifra: ";
cin>>c;
cout<<"Numarul "<<n<<" fara cifra "<<c<<" este "<<sterge_cifra(n,c);
return 0;
}