-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.java
More file actions
31 lines (29 loc) · 992 Bytes
/
Solution.java
File metadata and controls
31 lines (29 loc) · 992 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
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int[][] edges = new int[m][2];
for (int i = 0; i < m; i++) {
for (int j = 0; j < 2; j++) {
edges[i][j] = in.nextInt();
}
}
//System.out.println(Arrays.deepToString(edges));
int count = 0;
for (int j = 0; j < m; j++) {
for (int k = 0; k < 2; k++) {
/*if(edges[j][k] == 2) {
count++;
}*/
if(k == 0) {
System.out.print("[" + edges[j][k] + "]");
} else {
System.out.println("[" + edges[j][k] + "]");
}
}
}
}
}