close
import java.util.*;
public class triangle
{
public static void main (String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.printf("清輸入三角形邊長A: ");
int eage_a = sc.nextInt();
System.out.printf("清輸入三角形邊長B: ");
int eage_b = sc.nextInt();
System.out.printf("清輸入AB夾角: ");
int angle = sc.nextInt();
double shaped;
shaped = ( ( eage_a * eage_b * Math.sin(angle) ) / 2 );
System.out.printf("此三角形面積為: %g", shaped);
}
}
全站熱搜