Răspuns:
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n, c, x, uc, i;
cout <<"n=";
cin >> n;
cout <<"c=";
cin >> c;
i=0;
x=0;
while(n > 0)
{
uc = n % 10;
if (uc != c)
{
i++;
x = uc*pow(10, i-1) + x;
}
n = n / 10;
}
cout << "noul numar este x = " << x;
return 0;
}