Я пытаюсь выяснить, почему Math.max и Math.min не работают.
Я знаю, что мог бы использовать и, если бы еще, статистику, если бы тоже хотел, но есть ли способ сделать это без нее, если еще?
Scanner Scan = new Scanner(System.in);
System.out.println("Enter three integers(Use enter in between): ");
int x = Scan.nextInt();
int y = Scan.nextInt();
int z = Scan.nextInt();
System.out.println(
Math.min(x, Math.min(x, z))+", " // Prints the minimum of {x, z}
+Math.max(x, Math.max(y, z))+", " // Prints the maximum of {x, y, z}
+(
Math.max(x, Math.max(y, z)) // Get the max of {x, y, z}
+Math.min(x, Math.min(y, z)) // Get the min of {x, y, z}
// Sum should be the sum of smallest and largest of {x, y, z}
) // Convert to string
+(-x-y-z) // The sum of -1 * x+y+z, converted to String
); // println