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