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