分享下我的思路,基本就是两个for横向和竖向便利然后就是找规律了 while True: try: a = int(input()) num = 0 # 竖向遍历 for j in range(a): num = num + j row = num for i in range(j,a): row = row+1+i # 横向每行输出 print(row -...