Tasks resolved, but code does not validate. Why? Any idea?
package com.codegym.task.task04.task0417;
/*
Do we have a pair?
Suppose we have three numbers. Now let's imagine that they are not numbers, but people ...
Actually, never mind about that. We don't need to make this weird. Let's just check if there
is at least one pair of identical numbers among the three. If there is, we'll display it
on the screen. And if the three numbers are the same, we'll display all three.
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sNumber1 = reader.readLine();
int n1 = Integer.parseInt(sNumber1);
String sNumber2 = reader.readLine();
int n2 = Integer.parseInt(sNumber2);
String sNumber3 = reader.readLine();
int n3 = Integer.parseInt(sNumber3);
if (n1 == (n2+n3) - n2) {
System.out.print(n1 + " " + n2 + " " + n3);
} else if (n1 == n3){
System.out.print(n1 + " " + n3);
} else if (n2 == n1){
System.out.print(n2 + " " + n1);
} else if (n2 == n3){
System.out.print(n2 + " " + n3);
} else if (n3 == n1){
System.out.print(n3 + " " + n1);
} else if (n3 == n2){
System.out.print(n3 + " " + n2);
} else if (n1 == n2){
System.out.print(n1 + " " + n2);
}
else {}
}
}