December 23, 2018
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!
2 Comments
Add a Comment
You must be logged in to post a comment.
ad ơi sao code em ko nộp dc thế ạ, cứ running hoài à
Code của em cx gặp trường hợp giống bn lethenam2003