Skip to content

Commit

Permalink
add 009
Browse files Browse the repository at this point in the history
  • Loading branch information
akiray03 committed Sep 23, 2012
1 parent efd6a2d commit 5d342c8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 009/009.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1000.downto(1).each do |c|
(1000-c).downto(1).each do |b|
a = 1000 - c -b
next if a == 0
if a*a + b*b == c*c
puts "a:#{a}, b:#{b}, c:#{c}"
puts a * b * c
exit
end
end
end

0 comments on commit 5d342c8

Please sign in to comment.