本日學習:
import java.util.Scanner;
public class CH10_1{
public static void main(String[] args){
int[][][] a = new int[4][4][4];
Scanner sc = new Scanner(System.in);
for(int i = 0; i < 4; i++){
for(int j = 0; j <= i; j++){
for(int k = 0; k <= j; k++){
a[i][j][k] = sc.nextInt();
}
}
}
int max = a[0][0][0];
for(int i = 0; i < 4; i++){
for(int j = 0; j <= i; j++){
for(int k = 0; k <= j; k++){
if(a[i][j][k] > max)
max = a[i][j][k];
}
}
}
System.out.println(max);
sc.close();
}
}
public class CH10_2 {
public static void main(String[] args){
star(); // Call the star method to print a line of stars
System.out.print(" Wonderful tonight! ");
star();
}
public static void star(){
for(int i = 0; i < 18; i++)
System.out.print("*");
}
}
本日結語: