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