Sichanov

ss

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