返回列表 發帖
  1. package o;

  2. import java.util.Scanner;

  3. import java.util.*;
  4. public class foraddfinal
  5. {
  6.        
  7.                 static float tri(float x, float y)
  8.                 {
  9.                         return x*y/2;
  10.                 }
  11.                
  12.                 public static void main(String args[])

  13.                 {
  14.                         System.out.println("Base is 7 cm, and height is 5, meaning the area is"+tri(7,5)+" cm。");        
  15.                 }
  16.         }
複製代碼

TOP

返回列表