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