要是 UVA 支持 Lua 语言就好了
查看原帖
要是 UVA 支持 Lua 语言就好了
514727
bcdmwSjy楼主2024/10/7 19:50

代码仅 20 行

code=""
i=0
while true do
    s=io.read('*L')
    if not s then
        break
    end
    if string.sub(s,1,10)=="-- PROGRAM" then
        if i~=0 then
            print(string.format("Program %d:",i))
            loadstring(code)()
            code=""
        end
        i=i+1
    else
        code=code..s
    end
end
print(string.format("Program %d:",i))
loadstring(code)()

这样就是红题了,但是 UVA 不给力啊

2024/10/7 19:50
加载中...