Source

project-euler / Lua / 013.lua

Full commit
local f = assert(io.open("013.dat", "r"))
local line = f:read("*line")
local ns = {}
while line do
    ns[#ns + 1] = line
    line = f:read("*line")
end
f:close()
local total = 0
for i=1,#ns do
    total = total + ns[i]
end
print(total)