Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int x,p=1,n,r=0;
- cin>>x;
- do
- {
- n=x%10;
- if(n<5)
- {
- r=r+n*p;
- p=p*10;
- }
- x=x/10;
- }while (x!=0);
- cout<<r;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement