- public class ch37
- {
- public static void main(String args[])
- {
- float score[][]={{23,44,56,0},{85,70,71,0},{78,98,80,0},{35,12,55,0},{69,93,93,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();
- }
- }
- }
複製代碼 |