Created
July 23, 2015 09:30
-
-
Save akouryy/1496562f17a9013e4881 to your computer and use it in GitHub Desktop.
ゆ{2,}式
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
def yu; gets.to_i end | |
class Integer | |
def yu sym = nil | |
if sym | |
yu &sym | |
elsif block_given? | |
times.map{|i| yield gets.chomp} | |
else | |
times.map{gets.chomp} | |
end | |
end | |
end | |
class String | |
def yu; split.map &:to_i end | |
end | |
class Array | |
alias yu transpose | |
end | |
p yu.yu(:yu).yu | |
# p gets.to_i.times.map{gets.split.map &:to_i}.transpose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment