Venciity

[Java] circleAndRectangle

May 2nd, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. /*Напишете програма, която проверява дали дадена точка О (x, y) е вътре
  2. в окръжността К ((0,0), 5) и е извън правоъгълника ((-1, 1), (5, 5). */
  3.  
  4. import java.util.Scanner;
  5.  
  6.  
  7. public class circleAndRectangle {
  8.  
  9.     public static void main(String[] args) {
  10.        
  11.         Scanner input = new Scanner(System.in);
  12.         int x = input.nextInt();
  13.        
  14.         Scanner input2 = new Scanner(System.in);
  15.         int y = input2.nextInt();
  16.  
  17.         if (x <= 5 && y <= 5) {
  18.             if (x < -1 && y < 1) {
  19.                 System.out.println("Yes");
  20.             }
  21.             else {
  22.                 System.out.println("No");
  23.             }
  24.         }
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment