我希望这会打印一个最大的值。但它需要 3D 数组中 10 个最大的元素。
public class foo{
Public static void main(String[] args){
int row,col,dep=3;
int[][][] value=new int[row][col][dep];
/* insert the value from user or initialize the matrix*/
int max=0;
for(row=0;row<3;row++)
for(col=0;col<3;col++)
for(dep=0;dep<3;dep++)
if(value[row][col][dep]>max)
max=value[row][col][dep];
System.out.println(max);
}
}
慕田峪9158850
忽然笑
慕尼黑的夜晚无繁华
相关分类