返回列表 發帖
  1. public class Ch12 {

  2.         static float tri(float x,float y) {
  3.                 return x*y/2;
  4.         }
  5.     public static void main(String[] args)
  6.     {
  7.                  System.out.println("底為7公分,高危5公分的三角形,面積為"+tri(7,5)+"平方公分。");
  8.     }
  9. }
複製代碼

TOP

返回列表