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