riff-raff

GrupovaFaza

Nov 24th, 2018
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. imeOtbor = input()
  2. izigraniMachove = int(input())
  3. obshtoVkaraniGolove = 0
  4. obshtoPolucheniGolove = 0
  5. tochki = 0
  6. pobedi = 0
  7.  
  8. if (izigraniMachove != 0):
  9.     for mach in range(izigraniMachove):
  10.         vkaraniGolove = int(input())
  11.         polucheniGolove = int(input())
  12.  
  13.         obshtoVkaraniGolove += vkaraniGolove
  14.         obshtoPolucheniGolove += polucheniGolove
  15.  
  16.         if (vkaraniGolove > polucheniGolove):
  17.             pobedi += 1
  18.             tochki += 3
  19.         elif (vkaraniGolove == polucheniGolove):
  20.             tochki += 1
  21.         elif (polucheniGolove > vkaraniGolove):
  22.             tochki += 0
  23.  
  24.     razlika = obshtoVkaraniGolove - obshtoPolucheniGolove
  25.  
  26.     if (obshtoVkaraniGolove >= obshtoPolucheniGolove):
  27.         print(f"{imeOtbor} has finished the group phase with {tochki} points.")
  28.         print(f"Goal difference: {razlika}.")
  29.     elif(obshtoPolucheniGolove > obshtoVkaraniGolove):
  30.         print(f"{imeOtbor} has been eliminated from the group phase.")
  31.         print(f"Goal difference: {razlika}.")
Advertisement
Add Comment
Please, Sign In to add comment