Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class nhanvien:
- def __init__(self, hoten, lt, th):
- self.hoten = hoten
- self.lt = lt
- self.th = th
- self.tb=0
- self.loai=""
- def tinh(self):
- if self.lt>10: self.lt/=10
- if self.th>10: self.th/=10
- self.tb=(self.lt+self.th)/2
- if self.tb<5: self.loai="TRUOT"
- elif self.tb>=5 and self.tb<8: self.loai="CAN NHAC"
- elif self.tb>=8 and self.tb<9.5: self.loai="DAT"
- else: self.loai="XUAT XAC"
- def inra(self):
- self.tb=format(self.tb, ".2f")
- print(f"{self.hoten} {self.tb} {self.loai}")
- res=[]
- for t in range(int(input())):
- res.append(nhanvien(input(), float(input()), float(input())))
- for i in res: i.tinh()
- res.sort(key=lambda x:(-x.tb, x.hoten))
- for i in res: i.inra()
- '''
- 3
- Nguyen Thai Binh
- 45
- 75
- Le Cong Hoa
- 4
- 4.5
- Phan Van Duc
- 56
- 56
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement