2738๋ฒ: ํ๋ ฌ ๋ง์ (acmicpc.net)
1. ๋ด ์ฝ๋
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[][] former = new int[N][M];
int[][] latter = new int[N][M];
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
former[i][j] = sc.nextInt();
}
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
latter[i][j] = sc.nextInt();
}
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
System.out.printf("%d ", former[i][j]+latter[i][j]);
}
System.out.println();
}
}
}
0