7 lines
218 B
Text
7 lines
218 B
Text
local fmt = require "fmt"
|
|
|
|
local tests = { {"1110", 2}, {"112", 3}, {"16", 8}, {"14", 10}, {"e", 16}, {"e", 19} }
|
|
for tests as t do
|
|
local [n, b] = t
|
|
fmt.print("%6s in base %-2d = %d", n, b, tonumber(n, b))
|
|
end
|