Hey! Could someone have a look at my solution and help me figure out what is wrong ? Program works but not correctly, third step of the requirements fails :|
package pl.codegym.task.task04.task0441;
/*
Jakiś taki przeciętny
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
int d;
if(a<b && a > c){
d=a;
System.out.println(d);
}else if (b<a && b > c){
d=b;
System.out.println(d);
}else if (c<a && c>b){
d=c;
System.out.println(d);
}else if (a==b && b==c){
System.out.println(a);
}else if(a==b || a==c){
System.out.println(a);
}else if(b==a || b==c){
System.out.println(b);
}
}
}