我看出来第一题只要有奇有偶就排序,全奇全偶就原典序列输出,但他就是报运行错误,我真的奔溃了,第二题直接没做。各位大佬们能帮帮小弟看看是哪里有问题么。 while True: try: n=int(input()) nums = list(map(int,input().split(' &(30184)#39;))) res=0 hasEven = False hasOdd = False for num in nums: if num % 2 == 0: hasEven = True else: hasOdd = True if hasEven and hasOdd: nums.sort() for num in nums: res = res*10 +num print(res) except: break