標題:
陣列 (五)-成績表
[打印本頁]
作者:
鄭繼威
時間:
2023-3-3 19:46
標題:
陣列 (五)-成績表
利用二維陣列, 試做一個包含五位同學, 各三組分數的成績表格.
表格的形式如下:
public class Ch39
{
public static void main(String args[])
{
int score[][]={{90,85,85},
{56,48,91},
{87,56,55},
{23,25,53},
{88,82,95}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
錢冠叡
時間:
2023-3-4 17:25
public class Ch35
{
public static void main(String args[])
{
int score[][]={{100,100,100},
{0,0,0},
{0,1,0},
{1,0,1},
{87,87,87}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
侯宣任
時間:
2023-3-4 17:25
public class Ch39
{
public static void main(String args[])
{
int score[][]={{90,85,85},
{56,48,91},
{87,56,55},
{23,25,53},
{88,82,95}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
郭閎宇
時間:
2023-3-4 17:26
public class Ch01
{
public static void main(String args[])
{
int score[][]={{90,85,85},
{56,48,91},
{87,56,55},
{23,25,53},
{88,82,95}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
謝閔丞
時間:
2023-3-4 17:26
public class Ch35
{
public static void main(String args[])
{
int score[][]={{100,100,100},
{0,0,0},
{0,1,0},
{1,0,1},
{87,87,87}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
許浩浩
時間:
2023-3-4 17:28
import java.util.Scanner;
public class Ch01
{
public static void main(String args[])
{
int score[][]={{1,2,3},
{0,100,0},
{0,0,0},
{65,2,21},
{0,3,1}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
柏霖
時間:
2023-3-4 17:29
import java.io.Console;
public class test4 {
public static void main(String[] args)
{
int score[][]={{90,85,85},
{56,48,91},
{87,56,55},
{23,25,53},
{88,82,95}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
侯宣仲
時間:
2023-3-4 17:30
public class Ch39
{
public static void main(String args[])
{
int score[][]={{90,85,85},
{56,48,91},
{87,56,55},
{23,25,53},
{88,82,95}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
張駿霖
時間:
2023-3-5 09:38
public class Ch39
{
public static void main(String args[])
{
int score[][]={{90,85,85},
{56,48,91},
{87,56,55},
{23,25,53},
{88,82,95}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
孫文康
時間:
2023-3-11 15:56
public class Ch39
{
public static void main(String args[])
{
int score[][]={{90,85,85},
{56,48,91},
{87,56,55},
{23,25,53},
{88,82,95}};
System.out.println("座號\t國文\t英文\t數學");
System.out.println("============================");
for(int i=0; i<5; i++)
{
System.out.print((i+1)+"\t");
for(int j=0; j<3; j++)
System.out.print(score[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2