U E D R , A S I H C RSS

마름모출력/문보창

마름모 출력

~cpp 
def show_up_triangle(pattern, size):
    for i in range(size):
        print ' ' * (size - i),
        print pattern * (i * 2 + 1)
    return

def show_down_triangle(pattern, size):
    for i in range(size+1):
        print ' ' * i,
        print pattern * ((size-i) * 2 + 1)
    return

if __name__== '__main__':
    pattern = raw_input()
    size = input()
    show_up_triangle(pattern, size)
    show_down_triangle(pattern, size)
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:24
Processing time 0.0090 sec