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 自动生成的方法存根 } }
时间: 2024-10-11 11:11:41