public class ZDSH {

    public static void main(String[] args) {

        int[] a = new int[] { 10, 77, 45, 34, 56 };

        int b = 0;

        for (int i = 0; i < a.length; i++) {

            if (a[i] > b)
//System.out.println(i);
                b = a[i];
            
        }
        System.out.println(b);
        
        for(int i = 0;i < a.length;i++){
            if(a[i] < 15)
                b = a[i];
        }
        System.out.println(b);
        // TODO 自动生成的方法存根

    }

}

 

posted on 2015-12-06 22:29  halooomo  阅读(120)  评论(0编辑  收藏  举报