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