#P359. 【例62.1】 矩阵加法
【例62.1】 矩阵加法
Description
Given two matrices and of size , output their sum .
Input Format
First line contains two integers and , representing the number of rows and columns of the matrices. , .
Next lines, each containing integers, represent the elements of matrix .
Next lines, each containing integers, represent the elements of matrix .
Adjacent integers are separated by a single space, and each element is between and .
Output Format
Output lines, each containing integers, representing the result of matrix addition. Adjacent integers are separated by a single space.
Sample
3 3
1 2 3
1 2 3
1 2 3
1 2 3
4 5 6
7 8 92 4 6
5 7 9
8 10 12
Related
In following homework: