View Code of Problem 32

import java.util.Scanner;
import java.lang.Math;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int x=sc.nextInt();
		int y=sc.nextInt();
		int e[][]=new int[3][5];
		for(int i=0;i<e.length;i++){
			for(int j=0;j<e[i].length;j++){
				e[i][j]=sc.nextInt();
			}
		}
		int panduan=0;
		int d=sc.nextInt();
		double r=sc.nextDouble();
		for(int i=0;i<3;i++){
			double c=Math.sqrt((e[i][0]-x)*(e[i][0]-x)+(e[i][1]-y)*(e[i][1]-y));
			if(c<=d){
				if(r*c>=e[i][2]){
					panduan=1;
				}
			}
		}
		if( panduan==1){
			System.out.println("yes");
		}else{
			System.out.println("NO");
		}
	}
}
/*
Main.c:1:1: error: unknown type name 'import'
 import java.util.Scanner;
 ^
Main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
 import java.util.Scanner;
            ^
Main.c:2:1: error: unknown type name 'import'
 import java.lang.Math;
 ^
Main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
 import java.lang.Math;
            ^
Main.c:3:1: error: unknown type name 'public'
 public class Main {
 ^
Main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
 public class Main {
              ^
*/

Double click to view unformatted code.


Back to problem 32