三角,Python短代碼實現

def rectangle(m): n, b = 0, [1] while n < m: yield b b = [n+2]+ [b[i] + b[i + 1] for i in range(len(b) - 1)] + [n+2] n += 1 h=input() for x in rectangle(int(h)): pr
相關文章
相關標籤/搜索