Не пойму как ничего не выводить, остальное условие выполнено.
package com.javarush.task.task04.task0424;
/*
Три числа
*/
import java.util.Scanner;
public class Solution {
public static void compare(int c, int d, int e){
if (c != d && c != e){
System.out.println(1);
}
else if (d != c){
System.out.println(2);
}
else if(c == e && e == d){
}
else {
System.out.println(3);
}
}
public static void main(String[] args) throws Exception {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
compare(a,b,c);
}
}