Untitled
unknown
python
2 years ago
841 B
14
Indexable
birth_day = [int(x) for x in input().split(sep=' ')]
death_day = [int(x) for x in input().split(sep=' ')]
const_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
# print(birth_day) # ['980', '2', '12', '10', '30', '1']
# print(death_day) # ['980', '3', '1', '10', '31', '37'] 17
# ['1001', '5', '20', '14', '15', '16']
# ['9009', '9', '11', '12', '21', '11'] 2923033
years = (death_day[0] - birth_day[0]) * 365
years += (sum(const_month[birth_day[1]-1:death_day[1]])) - birth_day[2] - (const_month[death_day[1]] - death_day[2])
seconds = (death_day[3] - birth_day[3]) * 60 * 60
seconds += (death_day[4] - birth_day[4]) * 60
seconds += (death_day[5] - birth_day[5])
if seconds < 0:
print(str(years) + str(' ') + str(86400 + seconds))
else:
print(str(years - 1) + str(' ') + str(seconds))
Editor is loading...