我这里哪里错了,自己编的程序看着差不多啊
package 我还是爱你的;
public class hg {
public static void main(String[] args){
int scores[]={61,23,4,74,13,148,20};
int max=scores[0];
int main=scores[6];
double sum=0;
double avg=0;
for(int i=0;i<=scores.length;i++){
if(max<scores[i]){
max=scores[i];
}else if(main>scores[i]){
main=scores[i];
}
sum=sum+scores[i];
}
avg=sum/scores.length;
System.out.println(sum);
System.out.println(avg);
}
}