Advertisement
cupsamada

1.c

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