Advertisement
Malutan

1.c)2 numere

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