题目如图
我做的
import java.util.Scanner;
public class aver {
public static void main(String[] args) {
// TODO Auto-generated method stub
int ri, repeat;
int i, n, sum,a[];
float aver;
sum=0;
Scanner in=new Scanner(System.in);
repeat=in.nextInt();
for(ri=1; ri<=repeat; ri++){
n=in.nextInt();
a=new int[n];
for(i=0; i<=a.length-1; i++)
a[i]=in.nextInt(); //这个循环输入数组各元素
/*--------------*/
sum = sum + a[i];
aver=sum/n;
System.out.println("aver="+aver);
}
}
}
报错内容是这样,有人能帮我看看怎么改嘛qwq