Facebook
From Владимир Иванов, 2 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 546
  1. yes_no = input()
  2. start_meters = 5364
  3. count_of_days_without_relax = 0
  4. count_of_days = 0
  5. if yes_no == "Yes":
  6.     count_of_days = 1
  7. need_meters = 8848
  8.  
  9. while yes_no != "END" or start_meters != 8848 or count_of_days != 5:
  10.     if yes_no == "END":
  11.         break
  12.     if start_meters >= 8848:
  13.         break
  14.     if count_of_days == 5:
  15.         break
  16.  
  17.     next_meters = int(input())
  18.     start_meters += next_meters
  19.  
  20.     if yes_no == "Yes":
  21.         count_of_days += 1
  22.     elif yes_no == "No":
  23.         count_of_days_without_relax += 1
  24.  
  25.     if start_meters >= 8848:
  26.         break
  27.     else:
  28.         yes_no = input()
  29.  
  30.  
  31. if start_meters >= need_meters:
  32.     print(f"Goal reached for {count_of_days} days!")
  33.  
  34. else:
  35.     print("Failed!")
  36.     print(f"{start_meters}")