回答編集履歴
2
修正
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
int [][] numbers = {{1, 2, 3}, {4, 5}, {6}};
|
14
14
|
|
15
|
-
var
|
15
|
+
var result = Arrays.stream(numbers)
|
16
16
|
|
17
17
|
.map( xs ->
|
18
18
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
-
System.out.println(
|
31
|
+
System.out.println(result);
|
32
32
|
|
33
33
|
}
|
34
34
|
|
1
整形
test
CHANGED
@@ -12,15 +12,23 @@
|
|
12
12
|
|
13
13
|
int [][] numbers = {{1, 2, 3}, {4, 5}, {6}};
|
14
14
|
|
15
|
-
var r
|
15
|
+
var arr = Arrays.stream(numbers)
|
16
16
|
|
17
|
+
.map( xs ->
|
18
|
+
|
19
|
+
Arrays.stream(xs)
|
20
|
+
|
21
|
+
.mapToObj(x -> String.valueOf(x))
|
22
|
+
|
17
|
-
|
23
|
+
.collect(Collectors.joining(" "))
|
24
|
+
|
25
|
+
)
|
18
26
|
|
19
27
|
.collect(Collectors.joining("\n"));
|
20
28
|
|
21
29
|
|
22
30
|
|
23
|
-
System.out.println(r
|
31
|
+
System.out.println(arr);
|
24
32
|
|
25
33
|
}
|
26
34
|
|