Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void selSort(int* p,int l)
- {
- int max = p[0];
- int maxn = 0;
- for(int i = 0;i<l-1;++i)
- {
- for(int j = i;j<l;++j)
- if(p[j]>max)
- {
- max = p[j];
- maxn = j;
- }
- int t = p[i];
- p[i] = max;
- p[maxn] = t;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement