Java语言中,求数组中的最大值
来源:互联网 发布:手机qq皮肤制作软件 编辑:程序博客网 时间:2024/05/17 04:22
Java语言中,求数组中的最大值
package cc;
public class ShuZu {
public static void main(String[] args) {
int[] arr = { 5, 6, 2, 8, 12, 8 };
getmax(arr);
}
public static void getmax(int[] arr) {
int max=arr[0];
for (int a = 1; a< arr.length; a++) {
if (max< arr[a]) {
max=arr[a];}
}
System.out.println(max+ "");
}
}
0 0
- Java语言中,求数组中的最大值
- java数组中求最大值
- 【java】递归求数组中的最大值
- 求数组中的最大值
- 求数组中的最大值
- java求数组中最大值拓展--求老二
- java中数组求最大值、最小值、平均值。
- java求数组中最大值最小值
- 数组中求最大值
- 求数组中最大值
- 求数组中最大值
- java 数组求最大值
- 求数组中的最大值和次最大值、、、
- 求数组中数的最大值、最小值(C语言)
- 求给定数组中的最大值
- 求给定数组中的最大值
- 求二维数组中的最大值
- js 求数组中的最大值
- 找到环状序列的最小字典表示
- HDU 2018 母牛的故事(递推)
- HDU-4405 Aeroplane chess (概率DP)
- Java mail API学习
- goahead 移植与配置---fwqlzz love is for ever
- Java语言中,求数组中的最大值
- stack queue deque 用法
- 机器学习里面常用知识
- JavaScript基本排序算法(冒泡、选择、插入)
- java的数据类型
- 在hadoop环境下用spark跑wordcount(没有安装scala)
- 俄罗斯方块
- [Android]使用全局变量传递数据
- 小白笔记----------fork.c