public class HelloWorld {
public static void main(String[] args) {
int[] num = {61, 23, 4, 74, 13, 14, 8, 20};
int sum = 0;
int max = num[0];
int min = num[0];
for (int i = 0; i < num.length; i++) {
if (num[i] > max)
max = num[i];
if (num[i] < min)
min = num[i];
sum += num[i];
}
System.out.println("该数组最大值为:" + max);
System.out.println("该数组最小值为:" + min);
System.out.println("和为:" + sum);
}
}