Problem description
Give the number of N, find the maximum value, the minimum, and the number of N. Input format
The first behavior is an integer n that represents the number of numbers.
The second row has n number, for the given number of n, the absolute value of each number is less than 10000. Output format outputs three rows, one integer per line. The first line represents the maximum value in these numbers, the second row represents the minimum value in those numbers, and the third line represents the number of these numbers. Sample Input 5
1 3-2 4 5 Example output 5
-2
11 Data size and convention
1 <= N <= 10000.
Import Java.util.Scanner;
public class Main {public
static void Main (string[] args) {
int temp,max = 0,min = 0,sum=0;
Scanner input=new Scanner (system.in);
int N=input.nextint ();
for (int i=1;i<=n;i++) {
temp=input.nextint ();
Sum+=temp;
if (i==1) {
max=min=temp;
}
if (Temp>max) {
max=temp;
}
if (temp<min) {
min=temp
}
}}
SYSTEM.OUT.PRINTLN (max);
System.out.println (min);
SYSTEM.OUT.PRINTLN (sum);
}