- package cn.itcast.heima;
- public class Test1 {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- int[][] a={
- {12,13,55,5,98},
- {33,25,63,8,11},
- {46,29,36,78,19}
- };
- System.out.println(getMin(a));
- }
- private static int getMin(int[][] a) {
- // TODO Auto-generated method stub
- int min=a[0][0];
- for (int i = 0; i < a.length; i++) {
- for (int j = 0; j < a[i].length; j++) {
- if(a[i][j]<min){
- min=a[i][j];
- }
- }
- }
- return min;
- }
- }
复制代码 |