当前位置:网站首页>Find the largest number of two-dimensional arrays
Find the largest number of two-dimensional arrays
2022-04-23 01:54:00 【wx618230a1ee21c】
import
java.
util.
Arrays;
public
class
NUm {
public
static
void
main(
String[]
args)
throws
InterruptedException {
int[][]
num
=
new
int[
5][
5];
int
temp2
=
0;
// Initialize array
Array.
borth(
num[
0]);
Array.
borth(
num[
1]);
Array.
borth(
num[
2]);
Array.
borth(
num[
3]);
Array.
borth(
num[
4]);
System.
out.
println(
"num Array :"
+
Arrays.
deepToString(
num));
for(
int
i
=
0;
i
<
num.
length;
i
++){
for(
int
n
=
0;
n
<
num[
i].
length
-
1;
n
++){
int
temp
=
num[
i][
n];
if(
temp
>
num[
i][
n]){
temp2
=
temp;
}
else {
if(
temp2
<
num[
i][
n])
temp2
=
num[
i][
n];
}
}
}
System.
out.
println(
"num The largest value in the array is :"
+
temp2);
}
}
// Generate an array , The length is 5
class
Array{
public
static
void
borth(
int[]
o){
for (
int
i
=
0;
i
<
o.
length;
i
++){
int
num
= (
int) (
Math.
random()
*
100);
o[
i]
=
num;
}
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
The result is :

版权声明
本文为[wx618230a1ee21c]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220801260313.html
边栏推荐
- Use Xdebug breakpoint debugging in postman
- Challenges often faced by client project management
- 搭建网站是用物理机还是云主机好?
- J-Link RTT使用
- Jerry's CPU performance test [chapter]
- 紫光国微财报一枝独秀 2021年净利润三位数增长靠什么
- How to change the size of SVG pictures without width in openlayer
- About how to import C4d animation into lumion
- 哪些代码需要做单元测试?
- keil mdk中文乱码,两种解决方法,字体不再难看
猜你喜欢

腾讯云接口进行人脸检测 和签名出错问题

【动手学深度学习V2】循环神经网络-1.序列模型

MySQL basic record

数字藏品平台入驻 数字藏品平台开发 数字藏品SaaS平台

Problem solving: dpkg DEB: error: package name has characters that are't lowercase alphanums or '- +‘

CDR2022首发全新版本性能介绍

有哪些常见的代理ip问题?

Use of j-link RTT

什么时候应该编写单元测试?什么是TDD?

NR polar code VII - SCL (successful cancellation list coding)
随机推荐
NPM -- configure Taobao image
Learning methods and career development guide (2022 Edition)
BGP服务器在什么业务场景会被用到?
拨号服务器是什么,有什么用处?
Sqlserver data transfer to MySQL
使用单元测试框架编写单元测试的好处?
W801/W800-wifi-socket开发(二)-UDP蓝牙控制wifi连接
教程】如何用GCC“零汇编”白嫖MDK
Redis implements distributed locks
Under the pressure of sales, domestic mobile phones began to reduce prices, but they haven't put down their final face
如何对代理IP进行分类?
2022.4.10-----leetcode.804
Is CICC fortune a state-owned enterprise and is it safe to open an account
2022.4.10-----leetcode. eight hundred and four
postman里面使用 xdebug 断点调试
力扣(LeetCode)112. 路径总和(2022.04.22)
About how to import C4d animation into lumion
Dimension C China helping farmers in rural areas warms people's hearts the third stop is jiabaoguo farm
Use Xdebug breakpoint debugging in postman
Batch multiple files into one hex