第二题 m, n = list(map(int, input().split())) matrix = [[0] * n for _ in range(m)] N, t = m + n - 2, 1 for k in range(N + 1): i = min(k, m-1) while i > -1 and -1 < k - i < n: matrix[i][k-i] = t t += 1 i -= 1 print(matrix)
2 5

相关推荐

点赞 评论 收藏
分享
牛客网
牛客企业服务