pta中 python3中题:数组中偶数除以2 奇数乘以2后输出这些数值

a=list(map(int,input().split(" ")))
for i in a:

img


if i % 2==0:
i=i/2
i=int(i)
else :
i*=2
print(i,end=" ")

结果显示格式错误, 呃请问一下改怎么写

你还是发一下原题吧,既然是格式错误,你得发出来题目格式是啥啊

a=list(map(int,input().split(" ")))
for i in a:
    if i % 2==0:
        i=i/2
        i=int(i)
    else :
        i*=2
    print('{:4}'.format(i),end="")
a = list(map(int, input().split(" ")))
for i in a:
    # 偶数
    if i % 2 == 0:
        i = int(i / 2)
    # 奇数
    else:
        i *= 2
    print(i, end=" ")