Anonymous user
Averages/Arithmetic mean: Difference between revisions
no edit summary
No edit summary |
|||
Line 439:
mean = SUM(vec) / LEN(vec) ! 50
END </lang>
=={{header|Icon and Unicon}}==
==={{header|Icon}}===
<lang icon>procedure main(args)
every (s := 0) +:= !args
write((real(s)/(0 ~= *args)) | 0)
end</lang>
Sample outputs:
<pre>->am 1 2 3 4 5 6 7
4.0
->am
0
-></pre>
==={{header|Unicon}}===
The Icon solution also works in Unicon.
=={{header|IDL}}==
|