fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5.  
  6. Scanner scanner = new Scanner(System.in);
  7. while (scanner.hasNext()) {
  8. int x=scanner.nextInt();
  9. if(x==1999){
  10. System.out.printf("Correct\n");
  11. break;
  12. }
  13. else{
  14. System.out.printf("Wrong\n");
  15. }
  16.  
  17. }
  18. scanner.close();
  19. }
  20. }
Success #stdin #stdout 0.14s 56652KB
stdin
2200
1020
1999
1000
9999
stdout
Wrong
Wrong
Correct