import java.util.Scanner;
public class Main2 {
public static void main(String[] args) {
int[] a = new int[5];
int sum=0;
Scanner scanner = new Scanner(System.in);
for (int i = 0; i < a.length; i++) {
a[i] = scanner.nextInt();
sum += a[i];
}
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
System.out.println(sum);
}
}
/* 基础中的基础了,该认真学java了
*/
int [] a=new int[5];
int b=0;
Random random=new Random();
for(int i=0;i<5;i++){
//随机生成一个int添加进去
a[i]=random.nextInt();
system.out.println(a[i]);
b+=a[i]
}
system.out.println(b)
解决了的话关注我,不会的话私信我