Advertisement
Nenogzar

Untitled

Jan 19th, 2024
954
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. capacity = 255
  2. current_liters = 0
  3. line = int(input())
  4.  
  5. for _ in range(line):
  6.     liters = int(input())
  7.  
  8.     if current_liters + liters <= capacity:
  9.         current_liters += liters
  10.     else:
  11.         print("Insufficient capacity!")
  12.  
  13. print(current_liters)
  14.  
  15.  
  16. """ I. Shopov"""
  17.  
  18. # number_of_lines = int(input())
  19. # tank_capacity = 255
  20. # for line in range(number_of_lines):
  21. #     liters_of_water = int(input())
  22. #     if tank_capacity - liters_of_water < 0:  # No enough volume
  23. #         print("Insufficient capacity!")
  24. #         continue
  25. #     tank_capacity -= liters_of_water
  26. # print(255 - tank_capacity)
  27.  
  28. """ CEO """
  29.  
  30. # number_of_pipes = int(input())
  31. #
  32. # capacity = 255
  33. # total_capacity_left = 0
  34. #
  35. # for _ in range(number_of_pipes):
  36. #
  37. #     pipe = int(input())
  38. #
  39. #     if capacity - pipe >= 0:
  40. #         capacity -= pipe
  41. #         total_capacity_left += pipe
  42. #
  43. #     else:
  44. #         print("Insufficient capacity!")
  45. #
  46. # print(total_capacity_left)
Tags: water
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement