Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Напишете програма, която проверява дали дадена точка О (x, y) е вътре
- в окръжността К ((0,0), 5) и е извън правоъгълника ((-1, 1), (5, 5). */
- import java.util.Scanner;
- public class circleAndRectangle {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int x = input.nextInt();
- Scanner input2 = new Scanner(System.in);
- int y = input2.nextInt();
- if (x <= 5 && y <= 5) {
- if (x < -1 && y < 1) {
- System.out.println("Yes");
- }
- else {
- System.out.println("No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment