求大神告知代码错在哪里
package p;
public class pric {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] scores={61,148, 23, 4, 74, 13, 20} ;
int i=0,j=0,max=scores[i],min=scores[j],sum=0;
float avg=0;
for(;i<6;i++,j++) {
sum=sum+scores[i];
if(scores[i]<scores[i+1]) {
max=scores[i+1];
if(scores[j]<scores[j+1]) {
min=scores[j];
}
}
}
avg=sum/7;
System.out.println("数组中的最大值"+max);
System.out.println("数组中的最小值"+min);
System.out.println("数组中的元素总和"+sum);
System.out.println("数组中的平均值"+avg);
}
}