Skip to content

Instantly share code, notes, and snippets.

@kaworun
Created February 2, 2013 16:56
四則演算。
x = io.read()
y = io.read()
z = io.read()
function sum2(x, y, z)
if z == "+" then
print(x .. z .. y .. "=" .. x + y)
elseif z == "-" then
print(x .. z .. y .. "=" .. x - y)
elseif z == "*" then
print(x .. z .. y .. "=" .. x * y)
elseif z == "/" then
print(x .. z .. y .. "=" .. x / y)
end
end
sum2(x, y, z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment