回答編集履歴

2

修正

2020/03/10 17:43

投稿

asm
asm

スコア15147

test CHANGED
@@ -58,6 +58,10 @@
58
58
 
59
59
  #include <vector>
60
60
 
61
+ #include <numeric>
62
+
63
+
64
+
61
65
  using Func1 = std::function<int(int)>;
62
66
 
63
67
 

1

修正

2020/03/10 17:43

投稿

asm
asm

スコア15147

test CHANGED
@@ -82,7 +82,11 @@
82
82
 
83
83
  ary.push_back(process1(4));
84
84
 
85
- std::cout << ary[0](ary[1](ary[2](5)));
85
+ // std::cout << ary[0](ary[1](ary[2](5)));
86
+
87
+ std::cout << std::accumulate(ary.rbegin(), ary.rend(), 5,
88
+
89
+ [](int x, Func1 f){return f(x);});
86
90
 
87
91
  }
88
92