匿名 #6210(2008/04/24 00:30 GMT) [ Groovy ] Rating0/0=0.00
Felioさんのを参考に。
1 2 3 4 5 6 7 8
def print_pyramid(n){ (1..n).each{ x -> def text = '*' * (2*x - 1) println text.center(2*n + 1) } } print_pyramid(10)
Rating0/0=0.00-0+
[ reply ]
匿名
#6210()
[
Groovy
]
Rating0/0=0.00
Felioさんのを参考に。
def print_pyramid(n){ (1..n).each{ x -> def text = '*' * (2*x - 1) println text.center(2*n + 1) } } print_pyramid(10)Rating0/0=0.00-0+
[ reply ]