Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. for(int index = 0 ; index < scores.length ; index++)
  2. {
  3. if (newScore > scores[index] && (newScore > scores[0] || newScore < scores[index -1]))
  4. {
  5. System.arraycopy(scores, 0, temp, 0, index);
  6. temp[index] = newScore;
  7. System.arraycopy(scores, index, temp, (index+1), ((scores.length-1)-index));
  8. scores = temp;
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement