Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
$ include "seed7_05.s7i";
|
||||
include "float.s7i";
|
||||
|
||||
const array float: numVector is [] (1.0, 2.0, 3.0, 4.0, 5.0);
|
||||
|
||||
const func float: mean (in array float: numbers) is func
|
||||
result
|
||||
var float: result is 0.0;
|
||||
local
|
||||
var float: total is 0.0;
|
||||
var float: num is 0.0;
|
||||
begin
|
||||
if length(numbers) <> 0 then
|
||||
for num range numbers do
|
||||
total +:= num;
|
||||
end for;
|
||||
result := total / flt(length(numbers));
|
||||
end if;
|
||||
end func;
|
||||
|
||||
const proc: main is func
|
||||
begin
|
||||
writeln(mean(numVector));
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue