Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if(v[0]==n){
- for(int i=1;i<n;i++){
- if(l<v[i]){
- l=max(l,v[i]);
- idx1=i;
- }
- }
- for(int i=idx1;i<n;i++){
- cout<<v[i]<<" ";
- }cout<<v[idx1-1]<<" ";
- for(int i=0;i<idx1-1;i++){
- cout<<v[i]<<" ";
- }cout<<"\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement