Skip to content

Instantly share code, notes, and snippets.

@fsword
Created May 11, 2012 04:42
Show Gist options
  • Save fsword/2657582 to your computer and use it in GitHub Desktop.
Save fsword/2657582 to your computer and use it in GitHub Desktop.
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