返回列表 發帖
  1. public class ch37
  2. {
  3.     public static void main(String args[])
  4.     {
  5.          float score[][]={{23,44,56,0},{85,70,71,0},{78,98,80,0},{35,12,55,0},{69,93,93,0}};
  6.          System.out.println("座號\t國文\t英文\t數學\t平均");
  7.          System.out.println("=================================================");
  8.          for(int i=0; i<=4; i++)
  9.          {
  10.              System.out.print((i+1)+"\t");
  11.              score[i][3]=(score[i][0]+score[i][1]+score[i][2])/3;
  12.              for(int j=0; j<=3; j++)
  13.              {
  14.                    System.out.print(score[i][j]+"\t");
  15.              }
  16.              System.out.println();

  17.          }
  18.     }
  19. }
複製代碼

TOP

返回列表