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