Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         boolean e=true;
  6.         double a;
  7.  
  8.         do {
  9.             try{
  10.                 e=false;
  11.                 Scanner scan = new Scanner(System.in);
  12.                 String xd = scan.nextLine();
  13.                 a = Double.parseDouble(xd);
  14.  
  15.  
  16.             }
  17.             catch(NumberFormatException ee){
  18.                 System.err.println("Zły typ gościu");
  19.                 e=true;
  20.  
  21.             }
  22.         }
  23.         while(e==true);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement