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