Created
October 4, 2011 12:15
-
-
Save dchentech/1261488 to your computer and use it in GitHub Desktop.
1、11、111、1111、……的平方
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
# http://www.bjt.name/2011/06/beautiful-math-triangle-r/ | |
proc do |line| | |
(1..line).each do |num| | |
puts "#{' '*(line - num)}#{('1'*num).to_i**2}" | |
end | |
end.call((ARGV[0] || 36).to_i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment