Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.   int n, c;
  7.   cin >> n;
  8.   cin >> c;
  9.   int nou = 0, r = 0, z = 1;
  10.   while(n != 0)
  11.   {
  12.       if(n%10 != c)
  13.         {
  14.             r = r + z*(n%10);
  15.             z = z*10;
  16.         }
  17.       n = n/10;
  18.   }
  19.   cout << r;
  20.   return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement