Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
function f (x) return math.abs(x)^0.5 + 5*x^3 end
|
||||
|
||||
function reverse (t)
|
||||
local rev = {}
|
||||
for i, v in ipairs(t) do rev[#t - (i-1)] = v end
|
||||
return rev
|
||||
end
|
||||
|
||||
local sequence, result = {}
|
||||
print("Enter 11 numbers...")
|
||||
for n = 1, 11 do
|
||||
io.write(n .. ": ")
|
||||
sequence[n] = io.read()
|
||||
end
|
||||
for _, x in ipairs(reverse(sequence)) do
|
||||
result = f(x)
|
||||
if result > 400 then print("Overflow!") else print(result) end
|
||||
end
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
local a, y = {}
|
||||
function f (t)
|
||||
return math.sqrt(math.abs(t)) + 5*t^3
|
||||
end
|
||||
for i = 0, 10 do a[i] = io.read() end
|
||||
for i = 10, 0, -1 do
|
||||
y = f(a[i])
|
||||
if y > 400 then print(i, "TOO LARGE")
|
||||
else print(i, y) end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue