返回列表 發帖
  1. public class Ch01 {
  2.         public static void main(String[] args) {
  3.                 String title[]={"座號","姓名","國文","英文","數學","平均"};
  4.                 String name[]={"小叮噹","大熊","宜靜","技安","阿福"};
  5.                 int score[][]={{90,85,85},
  6.                                        {70,75,80},
  7.                                        {80,95,80},
  8.                                        {70,95,75},
  9.                                        {80,85,95}};
  10.                 int avg;
  11.                 for(int i=0; i<6; i++)
  12.                         System.out.print(title[i]+"\t");
  13.                 System.out.println("\n==============================================");
  14.                 for(int i=0; i<5; i++)
  15.                 {
  16.                         System.out.print((i+1)+"\t"+name[i]+"\t");
  17.                         for(int j=0; j<3; j++)
  18.                                 System.out.print(score[i][j]+"\t");
  19.                         avg=(score[i][0]+score[i][1]+score[i][2])/3;
  20.                         System.out.println(avg);
  21.                                        
  22.                 }   
  23.         }
  24. }
複製代碼
巨槌瑞斯!!!誇爪!!!哈哈哈哈!!!
還敢下來阿冰鳥

TOP

返回列表