Astrum96

Untitled

Nov 25th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  class select
  4.  {
  5.    public static void main(String args[])
  6.    {
  7.     Scanner reader = new Scanner(System.in);
  8.    
  9.     while (true) {
  10.       System.out.println("Type numbers");
  11.       int a = Integer.parseInt(reader.nextLine());
  12.      
  13.       if (a == -1) {
  14.         System.out.println("Thank you!");
  15.         break;
  16.       }
  17.       else {
  18.         a = Integer.parseInt(reader.nextLine());
  19.       }
  20.      
  21.     }
  22.    
  23.    }
  24.  }
Add Comment
Please, Sign In to add comment