咱比较笨,不会找数学规律,说下思路:1、创建n*n矩阵,-1赋值2、蛇形的规律是,直接模拟。 for i in range(n): for k in range(i+1): matrix[i-k][k] = num 3、按行输出结果 import sys n = int(input()) matrix = [[-1]*n for _ in range(n)] num = 1 for i in range(n): for k in range(i+1): matrix[i-k][k] = num num += 1 for i i...