blob: b20e835f460f0e1385f2c2a07d1eaa754ac75f09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/opt/local/bin/lua
--
-- See ../README.md
--
--
-- Run as: lua ch-1.lua < input-file
--
local s = 0
local c = 0
for n in io . lines () do
s = s + tonumber (n)
c = c + 1
print (s / c)
end
|