TPK algorithm: Difference between revisions

Content deleted Content added
Maerics (talk | contribs)
Ruby version: New implementation in same spirit but with more idiomatic Ruby, removed sentence about not repeating overflow values, since it is not discussed elsewhere in the article.
Maerics (talk | contribs)
m Ruby version: Used sqrt and abs per other implementations.
Line 65:
Array.new(11) { gets.to_i }.reverse.each do |x|
begin
y = 5Math.sqrt(x.abs) *+ 5*x ** 3
raise if y > 400
puts "#{x} #{y}"