Advertisement
Guest User

Untitled

a guest
Jan 8th, 2022
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. capacity = float(input())
  2. volume = input()
  3. copycat = capacity
  4. iteracion = 0
  5. successCases = 0
  6.  
  7. check = False
  8. while volume != "End":
  9.     currVolume = float(volume)
  10.     iteracion += 1
  11.     if iteracion == 3:
  12.         currVolume = currVolume * 110/100
  13.     if currVolume >= copycat:
  14.         check = True
  15.         break
  16.     copycat -= currVolume
  17.     successCases += 1
  18.     volume = input()
  19.  
  20. if check:
  21.     print("No more space!")
  22.     print(f"Statistic: {successCases} suitcases loaded.")
  23. else:
  24.     print("Congratulations! All suitcases are loaded!")
  25.     print(f"Statistic: {successCases} suitcases loaded.")
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement