I think my solution is correct.
I search for the middle value among 3 numbers, and display the number according to the task. And the system does not want to accept my solution.
package com.codegym.task.task04.task0441;
/*
Somehow average
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Podaj liczbę ");
int n1 = Integer.parseInt(br.readLine());
int n2 = Integer.parseInt(br.readLine());
int n3 = Integer.parseInt(br.readLine());
if (n1<n2 && n3< n1) System.out.println(n1);
else
if (n2<n3 && n1< n2) System.out.println(n2);
else
if (n3<n2 && n1< n3) System.out.println(n3);
else
if (n3== n1 && n1!= n2) {
if(Math.random()*2< 1)
System.out.println(n1);
else
System.out.println(n3);
}
else
if (n3== n2 && n1!= n2) {
if(Math.random()*2< 1)
System.out.println(n3);
else
System.out.println(n2);
}
else
if (n1== n2 && n1!= n3) {
if(Math.random()*2< 1)
System.out.println(n1);
else
System.out.println(n2);
}
else
if (n1== n2 && n1== n3)
if(Math.random()*3> 2)
System.out.println(n1);
else
if(Math.random()*3< 1)
System.out.println(n2);
else
System.out.println(n3);
}
}