Advertisement
tchenkov

L04u05_InvalidNumber

Jan 23rd, 2017
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. package Uprajneniq;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /**
  6.  * Created by todor on 23.01.2017 г..
  7.  */
  8. public class u05_InvalidNumber {
  9.     public static void main(String[] args) {
  10.  
  11.         Scanner scan = new Scanner(System.in);
  12.  
  13.         int num = Integer.parseInt(scan.nextLine());
  14.  
  15.         boolean isNumValid = num == 0 || (100<= num && num <= 200);
  16.  
  17.         if (!isNumValid) {
  18.             System.out.println("invalid");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement