Буду благодарен за помощь☺️
package com.javarush.task.task07.task0721;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Минимаксы в массивах
*/
public class Solution {
public static void main(String[] args) throws IOException {
int[] array = getInts();
int maximum = Integer.MIN_VALUE;
int minimum = Integer.MAX_VALUE;
for(int step = 0; step < 20; step++){
if(array[step] > maximum)
maximum = array[step];
else if (array[step] < minimum)
minimum = array[step];
}
//напишите тут ваш код
System.out.print(maximum + " " + minimum);
}
public static int[] getInts() throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[20];
for(int step = 0; step < 20; step++){
array[step] = Integer.parseInt(reader.readLine());
}
return array;
}
//напишите тут ваш код
}