It runs well, but verification is wrong. Does anybody see why?
Thanks a lot.
Best regards
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 maximum=0;
int minimum=0;
//write your code here
int[] array = new int[20];
for(int i=0;i<20;i++){
array[i] = Integer.parseInt(reader.readLine());
}
for(int i=0;i<array.length;i++){
if(array[i]>maximum)
maximum=array[i];
if(array[i]<minimum)
minimum=array[i];
}
System.out.println(maximum + " " + minimum);
}
}