Cannot figure out why this code doesn't work.
I pass 2, 1, 3 to the keyboard but 1 comes up as the middle number, doesn't seem possible. What am I missing!?
package com.codegym.task.task04.task0441;
/*
Somehow average
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
int a = Integer.parseInt(scanner.nextLine());
int b = Integer.parseInt(scanner.nextLine());
int c = Integer.parseInt(scanner.nextLine());
if ( a < b || a < c ) {
System.out.println(Math.min(b, c));
}
else if (b < c || b < a) {
System.out.println(Math.min(a, c));
}
else {
System.out.println(Math.min(a, b));
}
}
}