代码仅 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 不给力啊