Lua replacement for the % operator

前端 未结 6 1701
臣服心动
臣服心动 2020-12-30 19:39

I want to check, if a number is divisible by another number:

for i = 1, 100 do
    if i % 2 == 0 then
        print( i .. \" is divisible.\")
    end
end
         


        
6条回答
提交回复
热议问题