Teo_Yanchev

Dishwasher_while

Jul 6th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. bottles_detergent = int(input())
  2.  
  3. ml = bottles_detergent * 750
  4. fill = 0
  5. dishes_cleaned = 0
  6. pots_cleaned = 0
  7.  
  8. command = input()
  9. while command != "End":
  10. fill += 1
  11. command = int(command)
  12. if fill % 3 == 0:
  13. ml -= command * 15
  14. pots_cleaned += command
  15. else:
  16. ml -= command * 5
  17. dishes_cleaned += command
  18. if ml < 0:
  19. print(f"Not enough detergent, {abs(ml)} ml. more necessary!")
  20. break
  21. command = input()
  22. if ml >= 0:
  23. print("Detergent was enough!")
  24. print(f"{dishes_cleaned} dishes and {pots_cleaned} pots were washed.")
  25. print(f"Leftover detergent {ml} ml.")
Advertisement
Add Comment
Please, Sign In to add comment