Проверял все варианты
1 1 1 - выводит: 1 1 1
1 1 2 - выводит: 1 1
2 1 1 - выводит: 1 1
1 2 3 - ничего не выводит (вроде тоже правильно)
Все условия выполнены кроме 3 хотя все выполнено верно. Немного замудренный код в отличие от тех что предлагают в комментариях, но рабочий)
Подскажите что не так
package com.javarush.task.pro.task03.task0305;
import java.util.Scanner;
/*
Три числа
*/
public class Solution {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int number_one = scanner.nextInt();
int number_two = scanner.nextInt();
int number_three = scanner.nextInt();
boolean one_two = (number_one == number_two);
boolean two_three = (number_two == number_three);
if (one_two)
if (two_three)
System.out.println(number_one + " " + number_two + " " + number_three);
else
{
System.out.println(number_one + " " + number_two);
}
else
{
if (two_three)
System.out.println(number_two + " " + number_three);
}
}
}