Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ vector average

double avg1(std::vector<int> const& v) {
    return 1.0 * std::accumulate(v.begin(), v.end(), 0LL) / v.size();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vector #average
ADD COMMENT
Topic
Name
6+6 =