Advertisement
AnaBerende

Problema3

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