test1
This commit is contained in:
14
operators_14.py
Normal file
14
operators_14.py
Normal file
@@ -0,0 +1,14 @@
|
||||
s = float(input("Введите пробег первого дня (км): "))
|
||||
p = float(input("Введите процент увеличения: "))
|
||||
|
||||
total_distance = s
|
||||
current_distance = s
|
||||
|
||||
print(f"День 1: {current_distance:.1f} км")
|
||||
|
||||
for day in range(2, 11):
|
||||
current_distance = current_distance * (1 + p / 100)
|
||||
total_distance += current_distance
|
||||
print(f"День {day}: {current_distance:.1f} км")
|
||||
|
||||
print(f"\nСуммарный путь за 10 дней: {total_distance:.1f} км")
|
||||
Reference in New Issue
Block a user