Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- lua solution to codabbey challenge 4
- function split(s, delimiter)
- result = {};
- for match in (s..delimiter):gmatch("(.-)"..delimiter) do
- table.insert(result, match);
- end
- return result;
- end
- inp = io.read()
- b = {}
- c = {}
- for i=1,inp do
- a = split(io.read(), " ")
- for k, v in pairs(a) do
- table.insert(b,v)
- end
- table.insert(c, b)
- end
- d = inp*2
- for i=1,d,2 do
- print(math.min(tonumber(c[1][i]), tonumber(c[1][i+1])))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement