while True: try: num = int(input()) inputlist = input().split() inputlist = sorted(inputlist) for i in range(num): medianlist = inputlist[:i] + inputlist[(i+1):] L = len(medianlist) m = medianlist[int((L-1)/2)] print(m) except: break
while True: try: num = int(input()) inputlist = input().split() inputlist = sorted(inputlist) for i in range(num): medianlist = inputlist[:i] + inputlist[(i+1):] L = len(medianlist) m = medianlist[int((L-1)/2)] print(m) except: break
全部评论
(7) 回帖