import java.util.*; public class Main { public static void main(String[] args) { long sum = 0,mn = 100,mx = 0,n,x; Scanner scanner = new Scanner(System.in); n = scanner.nextLong(); for(int i = 1;i <= n;++i) { x = scanner.nextLong(); sum += x; mn = mn < x ? mn : x; mx = mx > x ? mx : x; } System.out.printf("%d\n%d\n%.2f",mx,mn,sum * 1.0 / n); } }
java有点太慢了。。。