Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() ///1234 13 24
- {
- int n, a,pa, b, pb, c;
- a=0 ;
- pa=1; ///cifrele impare
- b=0;
- pb=1; ///cifrele pare
- cin>>n;
- while(n!=0)
- {
- c=n%10;
- n=n/10;
- if(c%2==1)
- {
- a=a+pa*c;
- pa*=10;
- }
- else
- {
- b=b+pb*c;
- pb*=10;
- }
- }
- cout<<a<<' '<<b;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement