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