THE EXERCISE OF THE GUYS GUYS HAS BEEN MOVED TO THE MENU "EXERCISE OF Teacher"

Total goods, total column of the matrix

Threads: Enter an integer matrix N x M size. Sum of each row, each column of the matrix.
Input: The first line contains 2 n, m separated by spaces. The next n lines each containing m integers separated by spaces.
Output: two lines, the first line contains n numbers, each number is the sum of a row. The second line contains m number, each number is the sum of a column.
For example:

input:
2 2
3 5
1 7
output:
8 8
4 12

You are not logged in? Log in to Submit Now!

One Comment

Add a Comment