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
Exponential from Two Points
VWPASSATPOLIZEI
123
Surface Area of things (Incomplete)
ok
Goalless DRAWS
Truly random numbers (Lua)
фыв
Percentage Calculator (Subscribe to Madflag19)
cases