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