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