Hi, can anyone explain me what is wrong with my code? It works but somehow conditions are not checked off.
package pl.codegym.task.task07.task0721;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Minimum i maksimum w tablicach
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] tab = new int[20];
int maksimum = tab[0];
int minimum=111110;
//tutaj wpisz swój kod
for(int i=0;i<=19;i++){
int a = Integer.parseInt(reader.readLine());
tab[i]=a;
if(minimum>a){
minimum=a;
}
if(maksimum<a){
maksimum=a;
}
}
System.out.print(maksimum + " " + minimum);
}
}