|
|
back to boardAC Python 3.3 Posted by lomobit 28 Jul 2013 00:16 num = int(input()) arr = [] for i in range(num): arr.append([]) for j in range(num): arr[i].append([])
check = 1 for i in range(num-1,-1,-1): x = 0 y = i while y != num: arr[x][y] = check check += 1 y += 1 x += 1 for i in range(1,num,1): x = i y = 0 while x != num: arr[x][y] = check check += 1 y += 1 x += 1 string = '' for i in range(num): for j in range(num): string += (str(arr[i][j]) + ' ') print(string) string = '' |
|
|