C++STL 中的数值算法(iota、accumulate、adjacent_difference、inner_product、partial_sum)

以下算法均包含在头文件 numeric 中 ##1.iota 该函数可以把一个范围内的序列从给定的初始值开始累加 先看用法。 例: 假设我需要一个长度为10,从5开始递增的序列 vector a(10); iota(begin(a), end(a), 5); for (auto x : a

你可能感兴趣的:(C++STL 中的数值算法(iota、accumulate、adjacent_difference、inner_product、partial_sum))