728x90
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int m = Integer.parseInt(st.nextToken());
int[][] a = new int[n][m];
for(int l=0; l<2; l++) {
for(int i=0; i<n; i++) {
st = new StringTokenizer(br.readLine());
for(int j=0; j<m; j++) {
a[i][j] += Integer.parseInt(st.nextToken());
}
}
}
for(int i=0; i<n; i++){
for(int j=0; j<m; j++) {
System.out.printf(a[i][j] + " ");
}
System.out.println("");
}
}
}
728x90
반응형
'Algorithm > 백준' 카테고리의 다른 글
[알고리즘] 백준 10798 Java (0) | 2023.03.29 |
---|---|
[알고리즘] 백준 2566 JAVA (0) | 2023.03.28 |
[알고리즘] 백준 10808 JAVA (0) | 2022.12.21 |
[알고리즘] 백준 1267 JAVA (0) | 2022.12.20 |
[알고리즘] 백준 10093 JAVA (1) | 2022.12.19 |