import java.util.Scanner;
public class Triangle {
double a;
double b;
double c;
public void input()
{Scanner t=new Scanner(System.in);
int a=t.nextInt();
int b=t.nextInt();
int c=t.nextInt();
}
public double perimeter() {
return a + b + c;
}
public double area() {
return ((0.25) * Math.sqrt((a + b + c) * (a + b - c) * (a + c - b) * (b + c - a)));
}
}
package b;
import java.util.Scanner;
public class Circle {
double r;
public void input()
{Scanner t=new Scanner(System.in);
int r=t.nextInt();
}
public double perimeter() {
return 2 * 3.14 * r;
}
public double area() {
return 3.14 * r * r;
}
}
package c;
import java.util.Scanner;
public class Rectangle {
double a;
double b;
public void input()
{Scanner t=new Scanner(System.in);
int a=t.nextInt();
int b=t.nextInt();
}
public double perimeter() {
return 2 * (a + b);
}
public double area() {
return a * b;
}
}
import a.Triangle;
import b.Circle;
import c.Rectangle;
public class Result2{
public static void main(String[] args) {
Triangle s1= new Triangle();
System.out.println("請輸入三角形的三條邊:");
s1.input();
System.out.println("三角形周長:" + s1.perimeter());
System.out.println("三角形面積:" + s1.area());
Circle s2= new Circle();
System.out.println("請輸入圓的半徑:");
s2.input();
System.out.println("圓周長:" + s2.perimeter());
System.out.println("圓面積:" + s2.area());
Rectangle s3= new Rectangle();
System.out.println("請輸入矩形的長和寬:");
s3.input();
System.out.println("矩形周長:" + s3.perimeter());
System.out.println("矩形面積:"+ s3.area());
}
}