package com.codegym.task.task04.task0441; /* Somehow average */ import java.util.Scanner; public class Solution { public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(System.in); System.out.println("Enter the three numbers: "); int a = scanner.nextInt(); int b = scanner.nextInt(); int c = scanner.nextInt(); if(b > a && a > c || c > a && a > b) { System.out.print(a + " is the middle number"); }; if(a > b && b > c || b > a && c > b) { System.out.print(b + " is the middle number"); }; if(b > a && a > c || c > a && a > b) { System.out.print(a + " is the middle number"); }; if(b == a && a == c) { System.out.print(a + " is the middle number"); }; if(b == a && a < c) { System.out.print(a + " is the middle number"); }; if(c == a && a < b) { System.out.print(a + " is the middle number"); }; if(b == c && c < a) { System.out.print(c + " is the middle number"); }; } } I failed three requirements: 

 The program should display the middle number of the three numbers. If all the numbers are equal, display any one of them. If two of the three numbers are equal, display either of the two. Why? Thanks a lot.