这个为什么错
public class HelloWorld {
public static void main(String[] args) {
int [] scores={61,23,4,74,13,148,20};
int max=scores[0],min=scores[0],sum=scores[0];
double avg=0;
for(int i=1;i<=scores.length;i++){
min=(min<scores[i])?min:scores[i];
max=(max>scores[i])?max:scores[i];
sum=sum+scores[i];
}
avg=sum/scores.length;
System.out.println(max);
System.out.println(min);
System.out.println(sum);
System.out.println(avg);
}
}