Advertisement
georgiu_marius04

pr1b.tema

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