Adrian Perez |
|
i = 1; for line in io.readlines() do print(i .. ": ", line); i = i+1; end
for (int i=1, b[100];;i++) printf("%d: %s\n",i,gets((char*)b));
while 1 do i=(i or 0)+1 print(""..i..": "..io.read()) end or for i,ln in function(s,i) return i+1,""..i..": "..io.read() end,nil,1 do print(ln) end
main()
函数并包含 stdio.h
... 也许我总是过于担心代码的正确性,也许这个脚本并不是一个好的例子:P -- Adrian
while(<>) {print(++$i.": ".$_)}
awk '{print NR, $0}' -