返回列表 發帖
  1. import java.util.Scanner;


  2. public class A {

  3.         public static void main(String[] args) {
  4.                 Scanner s=new Scanner(System.in);
  5.                 float x, y;
  6.                 System.out.print("Enter the base of the triangle");
  7.                 x=s.nextFloat();
  8.                 System.out.print("Enter the height of the triangle");
  9.                 y=s.nextFloat();
  10.                 System.out.println("base"+x+"height"+y+"area"+x*y/2);
  11.         }

  12. }
複製代碼

TOP

返回列表