Created
May 11, 2012 04:42
-
-
Save fsword/2657582 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
while(s=gets) | |
a = s.split(' ') | |
puts IO.foreach('input.txt'){|line| | |
array = line.split(' '); | |
# 下面的判断若通过,则a的成员都在array中,可以直接返回 | |
break array[0] if( (array - a).size == array.size - a.size) | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment