vitalii_hrushyn
7/21/2016 - 5:05 PM

ShotToTheCircle.java

package com.gmail.vhrushyn;

import java.util.Scanner;

public class main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		double r = 4.0;
		System.out.println("Input x");
		double x = sc.nextDouble();
		System.out.println("Input y");
		double y = sc.nextDouble();
		
		if (Math.abs(x) > r || Math.abs(y) > Math.sqrt(r*r - x*x)) {
			System.out.println("you missed");
		}
		else {
			System.out.println("you hit");
		}
		
		sc.close();
	}
}