import sys sys.stdin.readline().strip().split() 善用map,可以直接转成列表。 比如nums = list(map(int,sys.stdin.readline().strip().split()))