python一行以空格隔开输入数组,提交代码显示“RE”,解决方案:
python使用“nums=[map(int,input().split()]"或者"nums=[int(i) for i in input().split()]"以空格隔开输入数组时,如果一行输入的数据太多会导致出现"RE"
解决方法:
换成这样子输出
n=int(input()) #数组长度
nums=[]
while len(nums)<n:
nums+=[int(i) for i in input().split()]
就可以完美解决了!
...
原创
2022-01-01 10:16:37 ·
894 阅读 ·
0 评论