Знаю что можно проще) просто интересно можно как-то через конструктор?
package com.javarush.task.task04.task0417;
/*
Существует ли пара?
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
int a, b, c;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
a = Integer.parseInt(reader.readLine());
b = Integer.parseInt(reader.readLine());
c = Integer.parseInt(reader.readLine());
showsame(a, b, c);
}
void showsame(int a, int b, int c){
if (a == b && b == c)
System.out.println(a + " " + a + " " + a);
else if (a == b || a == c){
System.out.println(a + " " + a);}
else if (a == c || b == c){
System.out.println(c + " " + c);}
}
}