What am I doing wrong? Getting error on: If two numbers are equal to each other, you must display them on the screen.
Please help. Thanks!
package com.codegym.task.task04.task0417;
/*
Do we have a pair?
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner input = new Scanner(System.in);
int x = input.nextInt();
int y = input.nextInt();
int z = input.nextInt();
if(x == y && z == y) {
System.out.println(x + " " + y + " " + z);
}
else {
if(x == y) {
System.out.println(x + " " + y);
}
if(x == z) {
System.out.println(x + " " + y);
}
if(y == z) {
System.out.println(y + " " + z);
}
}
}
}