Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int nrmaxim(int n)
- {
- int nrm = 0, p = 1 , m = n;
- do{
- nrm ++, p *= 10, m /= 10;
- }while(m != 0);
- int max = 0;
- p /= 10;
- while(nrm){
- if(n > max)
- max = n;
- n = n % p * 10 + n / p;
- nrm --;
- }
- return max;
- }
Advertisement
Add Comment
Please, Sign In to add comment