Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
classwork
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { Scanner sc=new Scanner(System.in); System.out.println("enter number of rows and colums"); int r=sc.nextInt(); int c=sc.nextInt(); int arr[][]=new int[r][c]; int i,j,s=0,h=0; System.out.println("enter the numbers"); for(i=0; i<r; i++) { for(j=0; j<c; j++) { arr[i][j]=sc.nextInt(); } } int f=0; for(i=0; i<r; i++) { s=0; for(j=0; j<c; j++) { s+=arr[i][j]; } if(s>h) { h=s; f=i; } } for( j=0; j<c; j++) { System.out.print(arr[f][j]+" "); } } }
run
|
edit
|
history
|
help
0
several at a time
PE #5
extends
ZonedDateTime testing
exp 2
Size and signedness of Java ints and longs
Reverse a String
Hello world
// Java Coding Challenge - 08: Reversing a Number using Mathematical Operations
Convert string array to lowercase.