Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Avg
SUBMITTED BY:
Guest
DATE:
June 19, 2014, 9:03 a.m.
FORMAT:
C++
SIZE:
242 Bytes
Raw
Download
Tweet
HITS:
1191
Go to comments
Report
double
CalculateAvg
(
std
::
vector
<
double
>
values
)
{
double
dAvg
=
0.0
;
if
(
values
.
size
()
>
0
)
{
for
(
auto
value
:
values
)
{
dAvg
+=
value
;
}
dAvg
/=
values
.
size
();
}
return
dAvg
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus