image.png
import java.util.Scanner;
public class Main {
static int max(int[]a){
int n = -10000;
for(int x : a){
if(x>n) n=x;
}
return n;
}
static int min(int[]a){
int n = 10000;
for(int x : a){
if(x<n) n=x;
}
return n;
}
static double sum(int[]a){
double n = 0;
for(int x : a){
n+=x;
}
return n;
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int[] a = new int[r];
for(int i = 0; i < r; i++){
a[i]=sc.nextInt();
}
System.out.println(max(a));
System.out.println(min(a));
String s = Double.toString(sum(a));
if(s.indexOf(".") > 0){
//正则表达
s = s.replaceAll("0+?$", "");//去掉后面无用的零
s = s.replaceAll("[.]$", "");//如小数点后面全是零则去掉小数点
}
System.out.println(s);
}
}
网友评论