fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main {
  6.  
  7. public static void main (String[] args) throws java.lang.Exception {
  8.  
  9. Scanner scanner = new Scanner(System.in);
  10. int a = scanner.nextInt(2);
  11. int b = scanner.nextInt(2);
  12. int c = scanner.nextInt(2);
  13. int result;
  14.  
  15. /*if (a == b && b == c && a == c) {
  16. System.out.print(1);
  17. }
  18. else if (a == b || b == c || a == c) {
  19. System.out.print(2);
  20. }
  21. else {
  22. System.out.print(3);
  23. }*/
  24.  
  25. result = (a == b && b == c && a == c) ? 1 : (a == b || b == c || a == c) ? 2 : 3;
  26.  
  27. System.out.print(result);
  28.  
  29. }
  30. }
Runtime error #stdin #stdout #stderr 0.12s 29360KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at Main.main(Main.java:10)