- public class ch34
- {
- public static void main(String args[])
- {
- float score[][]={{68,78,90,0},{55,70,78,0},{78,98,80,0},{35,56,55,0},{63,76,77,0}};
- System.out.println("座號\t國語\t英文\t數學\t平均");
- System.out.println("===========================================");
- for(int i=0; i<=4; i++)
- {
- System.out.print((i+1)+"\t");
- score[i][3]=(score[i][0]+score[i][1]+score[i][2])/3;
- for(int j=0; j<=3; j++)
- {
- System.out.print(score[i][j]+"\t");
- }
- System.out.println();
- }
- }
- }
複製代碼 |