Advertisement
denis_andrei10

eliminarecifremaimarica5

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