回答編集履歴
2
変数名訂正
test
CHANGED
@@ -14,6 +14,6 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
std::sort(&
|
17
|
+
std::sort(&a[0], &a[4], [](auto& x, auto& y){return x[0] < y[0];});
|
18
18
|
|
19
19
|
```
|
1
sort関数呼び出しのコードを追加
test
CHANGED
@@ -10,6 +10,10 @@
|
|
10
10
|
|
11
11
|
```C++
|
12
12
|
|
13
|
-
std::array<int,2> a[
|
13
|
+
std::array<int,2> a[] = {{7,2},{5,3},{10.5},{8,4}};
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
std::sort(&data[0], &data[4], [](auto& a, auto& b){return a[0] < b[0];});
|
14
18
|
|
15
19
|
```
|