Python3 代码
def reverse (nums, size):
n = [0]*size
for i in range(size):
n[i] = num [size - 1 - i]
for i in range(size):
num [i] = n[i]
n, s = map(int, input().split())
num = list(map(int, input().split()))
reverse (num, s)
for i in range (n):
print (num[i], end = " ")