java数组最大值

package Array;

/**
 * Project Name: one_java
 * File Name: FindMax
 *
 * @version 1.0
 * @author:wenerduo
 * @Date: 2022/01/03/下午 1:53
 * Copyright (c) 2022,
 */
public class FindMax {
    public static void main(String[] args) {
        int[] nums = {0, 1, 4, 5, 6, 24};
        int maxInde=0;
        for (int i = 0; i<nums.length; i++) {
            if ( nums[maxInde] <nums[i]){
                maxInde=i;
            }

        }
        System.out.println(nums[maxInde]);
    }
}
全部评论

相关推荐

10-13 13:49
南京大学 财务
饿魔:笑死我了,你简直是个天才
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务