-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathc1096.java
More file actions
31 lines (25 loc) Β· 1002 Bytes
/
c1096.java
File metadata and controls
31 lines (25 loc) Β· 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package codeup100;
import java.util.Scanner;
public class c1096 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//λ°λνμ μ¬λ € λμ ν° λμ κ°μ(n)κ° μ²« μ€μ μ
λ ₯λλ€.
//λμ§Έ μ€ λΆν° n+1 λ²μ§Έ μ€κΉμ§ ν λμ λμ μ’ν(x, y)κ° nμ€ μ
λ ₯λλ€.
//nμ 10μ΄νμ μμ°μμ΄κ³ x, y μ’νλ 1 ~ 19 κΉμ§μ΄λ©°, κ°μ μ’νλ μ
λ ₯λμ§ μλλ€.
int count = sc.nextInt(); // λ°λνμ μ¬λ € λμ ν° λμ κ°μ(n)
int[][] arr = new int[19][19]; //2μ°¨μλ°°μ΄μμ±
for(int i=0; i<count; i++){
int x=sc.nextInt();
int y=sc.nextInt();
arr[x-1][y-1] = 1;
}
sc.close();
//μΆλ ₯
for (int i=0; i<arr.length; i++){
for (int j=0; j<arr.length; j++){
System.out.printf("%d ", arr[i][j]);
}
System.out.println();
}
}
}