Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int n, p=0, p2=0, c, u=1, u2=1;
- cin>>n;
- while (n%10!=0)
- {
- c=n%10;
- if (c%3==0)
- {
- p=p+c*u;
- u=u*10;
- }
- else
- {
- p2=p2+c*u2;
- u2=u2*10;
- }
- n=n/10;
- }
- cout<<p<<" "<<p2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement