Answers for "c++ vector average"

C++
0

c++ vector average

double avg1(std::vector<int> const& v) {
    return 1.0 * std::accumulate(v.begin(), v.end(), 0LL) / v.size();
}
Posted by: Guest on July-06-2021

Browse Popular Code Answers by Language