-----------------------------------
Collections.sort(list);是个好东西
但是要学会排列
然后你才能浪
-----------------------------------
算法
1 import java.util.*;
2 public class Main {
3 public static void main(String[] args) {
4 Scanner sc = new Scanner(System.in);
5 ArrayList
6 int n = sc.nextInt();
7 for(int i=0;i
8 list.add(sc.nextInt());
9 Collections.sort(list);
10 System.out.println(list.get(list.size()-1));
11 System.out.println(list.get(0));
12 int x = 0;
13 for(int i:list)
14 x += i;
15 System.out.println(x);
16 }
17 }