解题思路:
注意事项:
参考代码:
arr = [] while True: try: arr.append(list(map(str, input().split('/')))) except: break M, D, Y = 0, 1, 2 for i in range(len(arr)): temp = i for j in range(i + 1, len(arr)): if arr[temp][Y] != arr[j][Y]: if arr[temp][Y] > arr[j][Y]: temp = j else: if arr[temp][M] > arr[j][M]: temp = j arr[i], arr[temp] = arr[temp], arr[i] [print("%s/%s/%s" % (arr[i][M], arr[i][D], arr[i][Y])) for i in range(len(arr))]
0.0分
0 人评分