第十一届蓝桥杯JavaA成绩分析
作者:互联网
第十一届蓝桥杯JavaA成绩分析
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有点太慢了。。。
标签:第十一届,JavaA,scanner,sum,mn,System,蓝桥,mx 来源: https://blog.csdn.net/qq_45985728/article/details/120378296