ramsess90

05. Computer Firm

Nov 29th, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. broi_kompiutri = int(input())
  2.  
  3. all_seils = 0
  4. all_ratings = 0
  5. for i in range(0, broi_kompiutri):
  6.     comp_number = int(input())
  7.     rating = comp_number % 10  # vzimam poslednata cifra
  8.     all_ratings += rating  # dobavqm retinga kym obstata suma
  9.     count_sail = comp_number // 10  # vzimam ostanalite cifri
  10.  
  11.     percent = -1  # namiram procenta
  12.     if rating == 2:
  13.         percent = 0
  14.     if rating == 3:
  15.         percent = 50
  16.     if rating == 4:
  17.         percent = 70
  18.     if rating == 5:
  19.         percent = 85
  20.     if rating == 6:
  21.         percent = 100
  22.  
  23.     this_seil = (count_sail * percent) / 100  # namiram kolko prodajbi sa napraveni spored procenta
  24.     all_seils += this_seil  # dobavqm prodajbite kym sbora
  25.  
  26. print(f'{all_seils:.2f}')  # printiram v nujniq format
  27. print(f'{(all_ratings / broi_kompiutri):.2f}')  # printiram v nujniq format
Advertisement
Add Comment
Please, Sign In to add comment