题解 | #递归画图#
递归画图
https://www.nowcoder.com/practice/d01d668861f84471872ff0e9c958cae2
def xc(n, x, y): if n < 9 and n > 0: if n == 7: print(x*" "+n*"#"+y*" ") else: print(x*" "+n*"#"+y*" ") xc(n+2, x-1, y-1) print(x*" "+n*"#"+y*" ") xc(1, 4, 4)
递归画图
https://www.nowcoder.com/practice/d01d668861f84471872ff0e9c958cae2
def xc(n, x, y): if n < 9 and n > 0: if n == 7: print(x*" "+n*"#"+y*" ") else: print(x*" "+n*"#"+y*" ") xc(n+2, x-1, y-1) print(x*" "+n*"#"+y*" ") xc(1, 4, 4)
相关推荐