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