Venciity

[Java] circle

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