Напишите программу ниже |
import java.io.*;
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] arr = new int[n];
for(int i = 0; i< n; i++)
{
int b = in.nextInt();
arr[i] = b;
}
System.out.println(arraySum(arr));
n = in.nextInt();
int m = in.nextInt();
int[][] arr2 = new int[n][m];
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++) {
int b = in.nextInt();
arr2[i][j] = b;
}
int arr3[] = rowSums(arr2);
for (int i = 0; i < arr3.length; i++)
System.out.print(arr3[i] + " ");
System.out.println("\n"+isDiverse(arr2));
}
static void printArray(int[][] arr, int n, int m)
{
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
System.out.print(arr[i][j] + " ");
}
System.out.println();
}
}
|
public static int arraySum(int[] arr)
{
|
|
}
public static int[] rowSums(int[][] arr2D)
{
|
|
}
public static boolean isDiverse(int[][] arr2D)
{
|
|
}
}
|