Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Conta valores acima da média - LUA
local sum, result = 0, 0 local intlist = {} listlen = io.read("*n"); if (listlen > 0 and listlen < 100) then -- Read input into an array and compute the sum for counter = 1, listlen, 1 do intlist[counter] = io.read("*n"); sum = sum + intlist[counter]; end -- Compute the average average = sum / listlen; -- Count the input values that are > average for num, value in ipairs(intlist) do if (num > average) then result = result + 1 end end -- Print result print ("Number of values > average is: ", result, "\n"); else print ("Error--input list length is not legal \n"); end
run
|
edit
|
history
|
help
0
Reverse strings function - Lua
bf-asm compiler test 2
python like round function in lua
help with lua number input
Show current system clock
anti.lua
MXR
String Searcher
Brainfuck Interpreter (Lua) [reposted]
hack