Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
67110 胡海峰老师 数组中元素交换 Python3 Accepted 34 MS 3772 KB 161 2024-03-13 22:16:18

Tests(10/10):


Code:

n = int(input()) a = input().split() tot = n//2 for i in range(tot): j = i*2 a[j],a[j+1] = a[j+1],a[j] b =[str(x) for x in a] print(' '.join(b))