Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Max in 2D array
import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int[][]array=new int[2][5]; int max; Scanner scan = new Scanner(System.in); for(int i=0; i<2; i++){ for(int z=0;z<5; z++){ array[i][z]= scan.nextInt(); } } max=array[0][0]; for(int i=0; i<2; i++){ for(int z=0;z<5; z++){ if (max<array[i][z]) max=array[i][z]; } } System.out.println(max); } }
run
|
edit
|
history
|
help
0
call para cons
jb14.0 tests
Multiples of 3 and 5
H
assign
Parse and flatten string
LeetCode 121 - Best time to buy and sell stock - O(n) solution
log
teat2
PE #6