import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import javax.crypto.Mac;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
String m="";
while((m=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(m);
double x=Double.parseDouble(st.nextToken());
double y=Double.parseDouble(st.nextToken());
double z=Double.parseDouble(st.nextToken());
double ans=rad(x, y, z);
String f=String.format("The radius of the round table is: %.3f\n",ans);
sb.append(f);
}
System.out.print(sb);
}
static double rad(double x,double y,double z){
if(x==0 ||y==0 ||z==0)
return 0;
double halfP=(x+y+z)/2;
return Math.sqrt((halfP-x)*(halfP-y)*(halfP-z)/halfP);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import javax.crypto.Mac;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
String m="";
while((m=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(m);
double x=Double.parseDouble(st.nextToken());
double y=Double.parseDouble(st.nextToken());
double z=Double.parseDouble(st.nextToken());
double ans=rad(x, y, z);
String f=String.format("The radius of the round table is: %.3f\n",ans);
sb.append(f);
}
System.out.print(sb);
}
static double rad(double x,double y,double z){
if(x==0 ||y==0 ||z==0)
return 0;
double halfP=(x+y+z)/2;
return Math.sqrt((halfP-x)*(halfP-y)*(halfP-z)/halfP);
}
}
No comments:
Post a Comment