public static void main(String[] args) {
// 计算平均数
int [] num = {1,2,3};
int snum = 0;
for (int i = 0; i < num.length; i++) {
snum += num[i];
}
System.out.println(snum);
double avg = snum/num.length;
System.out.println(avg);
}
public static void main(String[] args) {
// 计算平均数
int [] num = {1,2,3};
int snum = 0;
for (int i = 0; i < num.length; i++) {
snum += num[i];
}
System.out.println(snum);
double avg = snum/num.length;
System.out.println(avg);
}