Java 解法, 执行用时: 6ms, 内存消耗: 9412KB, 提交时间: 2021-12-26
public class Main { public static void main(String[] args) { int[][] arr = {{11,33,55},{22,44,66,88},{131,214,315,146},{928,827,726,625},{424,525}}; int sum=add(arr); System.out.println(sum); } public static int add(int[][] arr) { int sum=0; //write your code here...... for(int i = 0;i<arr.length;i++){ for(int j =0;j<arr[i].length;j++){ sum += arr[i][j]; } } return sum; } }
Java 解法, 执行用时: 7ms, 内存消耗: 9004KB, 提交时间: 2021-11-15
public class Main { public static void main(String[] args) { int[][] arr = {{11,33,55},{22,44,66,88},{131,214,315,146},{928,827,726,625},{424,525}}; int sum=add(arr); System.out.println(sum); } public static int add(int[][] arr) { int sum=0; //write your code here...... for(int i = 0;i<arr.length;i++){ for(int j =0;j<arr[i].length;j++){ sum += arr[i][j]; } } return sum; } }
Java 解法, 执行用时: 7ms, 内存消耗: 9020KB, 提交时间: 2022-02-08
public class Main { public static void main(String[] args) { int[][] arr = {{11,33,55},{22,44,66,88},{131,214,315,146},{928,827,726,625},{424,525}}; int sum=add(arr); System.out.println(sum); } public static int add(int[][] arr) { int sum=0; //write your code here...... for(int i = 0;i < arr.length;i++){ for(int j = 0;j < arr[i].length;j++){ sum += arr[i][j]; } } return sum; } }
Java 解法, 执行用时: 7ms, 内存消耗: 9024KB, 提交时间: 2022-02-08
public class Main { public static void main(String[] args) { int[][] arr = {{11,33,55},{22,44,66,88},{131,214,315,146},{928,827,726,625},{424,525}}; int sum=add(arr); System.out.println(sum); } public static int add(int[][] arr) { int sum=0; //write your code here...... for(int i=0;i< arr.length;i++){ for(int j= 0;j<arr[i].length;j++){ sum+=arr[i][j]; } } return sum; } }
Java 解法, 执行用时: 7ms, 内存消耗: 9028KB, 提交时间: 2022-02-08
public class Main { public static void main(String[] args) { int[][] arr = {{11,33,55},{22,44,66,88},{131,214,315,146},{928,827,726,625},{424,525}}; int sum=add(arr); System.out.println(sum); } public static int add(int[][] arr) { int sum=0; //write your code here...... for(int i =0;i<arr.length;i++){ for(int j=0;j<arr[i].length;j++){ sum+=arr[i][j]; } } return sum; } }