- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
#include <numeric>
#include <algorithm>
#include <iostream>
#include <functional>
#include <boost/iterator/counting_iterator.hpp>
int main()
{
std::cout << std::accumulate(boost::make_counting_iterator(2), boost::make_counting_iterator(8), 1, std::multiplies<int>());
return 0;
}
А что, функциональный стиль вычисления факториала 8 🙂
Нам нравится.