Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What Am I Doing Wrong?

Name: Anonymous 2008-05-22 22:02

http://javabat.com/prob?id=AP1.scoresIncreasing

public boolean scoresIncreasing(int[] scores) {
  boolean increase = true;
 
  for (int i = 1; ((i) < (scores.length + 1)); i++){
  if (scores[i] > scores[i+1]){
  increase = false;
  }
  }
 
  return increase;
}

Name: Anonymous 2008-05-24 19:58

public boolean isScoresIncr(int[] scores) {
  if (scores.length < 2)
     return true;
  int i=0;
  do {
     if (scores[i] > scores[++i])
        return false;
  } while (i < scores.length - 1);
  return true;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List