import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main (String[] args) throws FileNotFoundException, IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb=new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
StringTokenizer st=new StringTokenizer(line,";");
StringBuilder str=new StringBuilder(st.nextToken());
str.delete(0, 9);
str.deleteCharAt(str.length()-1);
StringTokenizer st2=new StringTokenizer(str.toString(),",");
double centerX=Double.parseDouble(st2.nextToken());
double centerY=Double.parseDouble(st2.nextToken().trim());
str=new StringBuilder(st.nextToken());
str.delete(0, 9);
double radius=Double.parseDouble(str.toString());
str=new StringBuilder(st.nextToken());
str.delete(0, 9);
str.deleteCharAt(str.length()-1);
st2=new StringTokenizer(str.toString(),",");
double pX=Double.parseDouble(st2.nextToken());
double pY=Double.parseDouble(st2.nextToken().trim());
sb.append(!(eculDist(pX, pY, centerX, centerY)>radius)).append("\n");
}
System.out.print(sb);
}
static double eculDist(double x1,double y1,double x2,double y2){
return Math.sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
}
}
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main (String[] args) throws FileNotFoundException, IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb=new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
StringTokenizer st=new StringTokenizer(line,";");
StringBuilder str=new StringBuilder(st.nextToken());
str.delete(0, 9);
str.deleteCharAt(str.length()-1);
StringTokenizer st2=new StringTokenizer(str.toString(),",");
double centerX=Double.parseDouble(st2.nextToken());
double centerY=Double.parseDouble(st2.nextToken().trim());
str=new StringBuilder(st.nextToken());
str.delete(0, 9);
double radius=Double.parseDouble(str.toString());
str=new StringBuilder(st.nextToken());
str.delete(0, 9);
str.deleteCharAt(str.length()-1);
st2=new StringTokenizer(str.toString(),",");
double pX=Double.parseDouble(st2.nextToken());
double pY=Double.parseDouble(st2.nextToken().trim());
sb.append(!(eculDist(pX, pY, centerX, centerY)>radius)).append("\n");
}
System.out.print(sb);
}
static double eculDist(double x1,double y1,double x2,double y2){
return Math.sqrt(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)));
}
}
No comments:
Post a Comment