Created
December 1, 2015 05:25
-
-
Save negabaro/97702aa74c34ffe2a3a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cnt =0 | |
inputs = [] | |
while str = STDIN.gets | |
inputs << str.to_i | |
end | |
inputs.each do |i| | |
inputs2 = inputs.dup | |
inputs2.delete(i) | |
inputs2.each do | j | | |
if (i.to_i + j.to_i) == 0 then | |
inputs.delete(i) | |
cnt = cnt + 1 | |
end | |
end | |
end | |
puts cnt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment