void SortByScore(long id[], float score[], int n) { int lh, rh; int FindHighestScore(float score[], int low, int high); for (lh = 0; lh < n; lh++) { rh = FindHighestScore(score, lh, n-1); SwapId(id, lh, rh); SwapScore(score, lh, rh); } } int FindHighestScore(float score[], int low, int high) { int i, spos; spos = low; for (i = low; i <= high; i++) { if (score[i] > score [spos]) spos = i; } return (spos); }