desislava_topuzakova

06. Number in Range

Jun 19th, 2021
616
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class NumberInRange_06 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int number = Integer.parseInt(scanner.nextLine());
  7.         //[-100; 100] и != 0
  8.         //number >= - 100
  9.         //number <= 100
  10.         //number != 0
  11.         if (number >= -100 && number <= 100 && number != 0) {
  12.             System.out.println("Yes");
  13.         } else {
  14.             System.out.println("No");
  15.         }
  16.     }
  17. }
RAW Paste Data