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