public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[20];
int maximum = 0;
int minimum = 500000000;
for(int i=0;i<20;i++){
array[i] = Integer.parseInt(reader.readLine());
}
for(int i=0;i<20;i++){
if(maximum < array[i]) {
maximum = array[i];
}
if(minimum > array[i]){
minimum = array[i];
}
}
System.out.print(maximum + " " + minimum);
}
}
package com.codegym.task.task07.task0721;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Min and max in arrays
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[20];
int maximum = 0;
int minimum = 500000000;
for(int i=0;i<20;i++){
array[i] = Integer.parseInt(reader.readLine());
}
for(int i=0;i<20;i++){
if(maximum < array[i]) {
maximum = array[i];
}
if(minimum > array[i]){
minimum = array[i];
}
}
System.out.print(maximum + " " + minimum);
}
}