import java.util.Scanner;
public class exam_1_3 {
public static void main(String args[]) {
System.out.println("请输入圆的半径:");
Scanner sc=new Scanner(System.in);
double r=sc.nextDouble();
Yuanxing_1_3 yuanxing=new Yuanxing_1_3();
System.out.print(yuanxing.C_Yuanxing(r));
System.out.println("请输入三角形的边长:");
Scanner sca=new Scanner(System.in);
double x=sca.nextDouble();
double y=sca.nextDouble();
double z=sca.nextDouble();
C_1 sanjiaoxing=new Sanjiaoxing_1_3();
try {
System.out.print(sanjiaoxing.C_Sanjiaoxing(x, y, z));
} catch (MyException_1_3 e) {
System.out.print(e.getMessage());
}
sc.close();
}
}
class Sanjiaoxing_1_3 implements C_1{
public double C_Sanjiaoxing(double x1, double y1, double z1) throws MyException_1_3{
if((x1+y1<=z1)||(x1+z1<=y1)||(y1+z1<=x1)) {
MyException_1_3 MyEx=new MyException_1_3();
throw MyEx;
}
return x1+y1+z1;
}
}
class Yuanxing_1_3 implements C_1{
double pi=3.14;
public double C_Yuanxing(double r) {
return 2*pi*r;
}
}
interface C_1{
double C_Sanjiaoxing(double x1,double y1,double z1) throws MyException_1_3;
double C_Yuanxing(double r);
}
class MyException_1_3 extends Exception{
String message;
MyException_1_3(){
message="错误提示:两边之和小于第三边";
}
public String getMessage(){
return message;
}
}