Content deleted Content added
m →Ruby version: Used sqrt and abs per other implementations. |
|||
Line 51:
return sqrt(abs(t))+5*t**3
a = [int(raw_input()) for i in range(11)]
for i in
y = f(i)
if y > 400:
print
else:
print
</source>
This can be made shorter at the expense of clarity:
<source lang="python">
from math import sqrt
f = lambda t: sqrt(abs(t))+5*t**3
a = [int(raw_input()) for i in range(11)]
for i in a[::-1]:
print i,
print "TOO LARGE" if y > 400 else f(i)
</source>
|