Advertisement
a53

cmmnr

a53
Oct 17th, 2021
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. long long m,n,p=1,nmax=0;
  7. cin>>n;
  8. while(p<=n)
  9. {
  10. m=n/p/10*p+n%p;
  11. if(m>nmax)
  12. nmax=m;
  13. p*=10;
  14. }
  15. cout<<nmax;
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement