rubikitch #142(2007/07/04 17:03 GMT) [ Ruby ] Rating0/0=0.00
さくっと書き上げてみた。
1 2 3 4 5 6 7 8 9 10
def stars(n) 2*n-1 end def pyramid(n) 1.upto(n) do |i| puts(("*"*stars(i)).center(stars(n))) end end pyramid(10)
Rating0/0=0.00-0+
[ reply ]
rubikitch
#142()
[
Ruby
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]