This is my code and I have information that this one is incorrect (third requirement). In my opinion it work correct. Any suggestions?
Thanks for help.
package pl.codegym.task.task04.task0441;
/*
Jakiś taki przeciętny
*/
import java.io.*;
import java.lang.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader x = new BufferedReader(new InputStreamReader(System.in));
float l1 = Float.parseFloat (x.readLine());
float l2 = Float.parseFloat(x.readLine());
float l3 = Float.parseFloat(x.readLine());
//int l1 = Integer.parseInt (x.readLine());
//int l2 = Integer.parseInt (x.readLine());
//int l3 = Integer.parseInt (x.readLine());
float srednia = srednia (l1,l2,l3);
float r1 = roznicaOdSredniej (srednia,l1);
float r2 = roznicaOdSredniej (srednia,l2);
float r3 = roznicaOdSredniej (srednia,l3);
if (r1<=r2 && r1<=r3){
int lx1 = (int) l1;
System.out.println(lx1);
}
else if (r2<=r1 && r2<=r3){
int lx2 = (int) l2;
System.out.println(lx2);
}
else if (r3<=r1 && r3<=r2){
int lx3 = (int) l3;
System.out.println(lx3);
}
}
public static float srednia (float a, float b, float c){
return ((a+b+c)/3);
}
public static float roznicaOdSredniej (float a, float b){
return Math.abs(a-b);
}
}