Advertisement
AnaBerende

Problema2

Nov 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,r=0,p=1;
  6. cin>>n;
  7. do
  8. {
  9. if(n%10==2 || n%10==3 || n%10==5 || n%10==7)
  10. {
  11. r=r+n%10*p;
  12. p=p*10;
  13. }
  14. n=n/10;
  15. }
  16. while(n!=0);
  17. cout<<r;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement