Advertisement
Spocoman

06. World Swimming Record

Dec 16th, 2021 (edited)
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. record_seconds = float(input())
  2. distance_meters = float(input())
  3. time_meter_per_seconds = float(input())
  4.  
  5. total = distance_meters * time_meter_per_seconds + distance_meters // 15 * 12.5
  6.  
  7. if record_seconds > total:
  8.     print(f'Yes, he succeeded! The new world record is {total:.2f} seconds.')
  9. else:
  10.     print(f'No, he failed! He was {total - record_seconds:.2f} seconds slower.')
  11.  
  12. Тарикатско решение:)
  13.  
  14. record = float(input())
  15. distance = float(input())
  16.  
  17. total = distance * float(input()) + distance // 15 * 12.5
  18.  
  19. print(f'Yes, he succeeded! The new world record is {total:.2f} seconds.' if record > total
  20.       else f'No, he failed! He was {total - record:.2f} seconds slower.')
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement