fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Scanner;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone {
  10.  
  11. public static void main(String[] args) {
  12.  
  13. int podajPIN;
  14. int PIN = "0999".hashCode();
  15.  
  16. System.out.println("Podaj PIN");
  17. podajPIN = getString();
  18.  
  19. if (podajPIN == PIN) {
  20. System.out.println("Podałeś dobry PIN");
  21. } else {
  22. System.out.println("Podany PIN jest nieprawidłowy");
  23. }
  24. }
  25.  
  26. public static int getString() {
  27. return new Scanner(System.in).nextLine().hashCode();
  28. }
  29.  
  30. }
  31.  
  32.  
Success #stdin #stdout 0.1s 49560KB
stdin
0999
stdout
Podaj PIN
Podałeś dobry PIN