desislava_topuzakova

04. Number 100...200

Jun 12th, 2021
650
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class NumberInRange {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         //1. прочитаме цяло число
  7.         int number = Integer.parseInt(scanner.nextLine());
  8.  
  9.         //2. проверки
  10.             // число < 100 -> Less than 100
  11.             // число <= 200 -> Between 100 and 200
  12.             // число > 200 -> Greater than 200
  13.         if (number < 100) {
  14.             System.out.println("Less than 100");
  15.         } else if (number <= 200) {
  16.             System.out.println("Between 100 and 200");
  17.         } else if (number > 200) {
  18.             System.out.println("Greater than 200");
  19.         }
  20.     }
  21. }
RAW Paste Data