Result

WA

Duration

496ms

Code [DL]

function split(str, delim)
    -- Eliminate bad cases...
    if string.find(str, delim) == nil then
        return { str }
    end

    local result = {}
    local pat = "(.-)" .. delim .. "()"
    local lastPos
    for part, pos in string.gfind(str, pat) do
        table.insert(result, part)
        lastPos = pos
    end
    table.insert(result, string.sub(str, lastPos))
    return result
end

s=""
while true do
    s =s..io.read()
    if line == nil then return end
end
t = split(s, " ")
for k,v in pairs(t) do
    print(v)
end

stdin

52 25 15
08 42 96
96 33 87
17 48 99

stdout

stderr

strace