Advertisement
OlteanuVlad0106

1.1

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