Условия выполняет, даже с двумя равными числами...
package com.javarush.task.task04.task0441;
/*
Как-то средненько
*/
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner s= new Scanner(System.in);
int d = s.nextInt();
int f = s.nextInt();
int g = s.nextInt();
if(d>=f&&f>=g){
System.out.println(f);
}
else if(g>=f&&f>=d){
System.out.println(f);}
else if(f>=d&&d>=g) {
System.out.println(d);
}
else if(g>=d&&d>=f){
System.out.println(d);
}
else if(d>=g&&g>=f){
System.out.println(g);
}
else if(f>=g&&g>=f){
System.out.println(g);
}
}}