package _12_数组练习;

public class Test8 {
    public static void main(String[] args) {
        /**
         * 定义数组求最大值：33,5,22,44,55
         * 求最大值
         * 思路:
         * 假设int max = arr[0]
         * 遍历 1   如果遍历过程中值有比max 大, 就把值赋给max
         */
        int[] arr = {33,5,22,44,55};
        int max = arr[0];

        for (int i = 0; i < arr.length; i++) {
            if(arr[i]> max){
                max = arr[i];
            }
        }
        System.out.println("数组中最大值为:"+ max);
    }
}
