Advertisement
tungSfer

tuyen nhan vien

Jan 16th, 2022
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. a = []
  2. for i in range(1, int(input()) + 1):
  3.     id = "TS"
  4.     if i < 10:
  5.         id += "0"
  6.     id += str(i)
  7.     name = input()
  8.     d1 = float(input())
  9.     if d1 > 10:
  10.         d1 /= 10
  11.     d2 = float(input())
  12.     if d2 > 10:
  13.         d2 /= 10
  14.     aver = (d1 + d2) / 2
  15.     status = ""
  16.     if aver < 5:
  17.         status = "TRUOT"
  18.     elif aver < 8:
  19.         status = "CAN NHAC"
  20.     elif aver <= 9.5:
  21.         status = "DAT"
  22.     else:
  23.         status = "XUAT SAC"
  24.     a.append([id, name, aver, status])
  25. a.sort(key = lambda x: (-x[2], int(x[0][2:]), x[1]))
  26. for i in a:
  27.     print(i[0], i[1], round(i[2], 2), i[3])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement