返回列表 發帖
  1. public class Ch11 {
  2.        
  3.        
  4.         static void hello(int n){
  5.                
  6.                 for(int i=0;i<n;i++){
  7.                         System.out.println("Hello!!!");
  8.                 }               
  9.         }
  10.         static float tri(float a,float b ){
  11.                 return a*b/2;
  12.         }
  13.         public static void main(String[] args){
  14.                 System.out.println("底7公分,高5公分的三角形,面積為"+tri(7,5)+"平方公分。");
  15.                
  16.         }
  17.        
  18.        
  19. }
複製代碼

TOP

返回列表