Advertisement
georgiu_marius04

pr1c.tema

Nov 18th, 2019
98
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,x3=0,p=1,p2=1;
  6. cin>>x;
  7. do
  8. {
  9.  
  10. if(x%10%3==0)
  11. {
  12. x2=x2+x%10*p;
  13. p=p*10;
  14. }
  15. else
  16. {
  17. x3=x3+x%10*p2;
  18. p2=p2*10;
  19. }
  20. x=x/10;
  21. } while(x);
  22.  
  23. cout<<x2<<" "<<x3;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement