martinvalchev

Invalid Number

Oct 30th, 2017
106
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. public class InvalidNumber {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int input = Integer.parseInt(scanner.nextLine());
  7.  
  8.         if (input == 0) {
  9.             System.out.println();
  10.         } else if (input < 100) {
  11.             System.out.println("invalid");
  12.         } else if (input > 200) {
  13.             System.out.println("invalid");
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment