int[][]arr={{3,5,8},{5,9,2},{7,10,6}}; 怎么打印出最大值数组啊
1 回答
![?](http://img1.sycdn.imooc.com/585a52eb0001f22207000700-100-100.jpg)
yanrun
TA贡献317条经验 获得超240个赞
public static void main(String[] args) { int[][]arr={{3,5,8},{5,9,2},{7,10,6}}; int max = arr[0][0]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { if(arr[i][j] > max) { max = arr[i][j]; } } } System.out.print(max); }
添加回答
举报
0/150
提交
取消