a = int(input())
b = int(input())
t = int(input())
print((a*60+b+t)//60)
print((a*60+b+t)%60)
ans = 0
for i in range(27, 100):
if i - 27 == int(str(i)[1] + str(i)[0]):
ans += 1
print(ans)
total = 200
ans = []
for i in range(1, total):
x_1 = i
x_2 = 10 * x_1
if (total - x_1 - x_2*2) % 5 == 0 and (total - x_1 - x_2*2) >= 0:
x_5 = (total - x_1 - x_2 * 2) // 5
ans.append(x_1 + x_2 + x_5)
print(min(ans))
import math
n = int(input())
for i in range(n):
indx = [0, 0, 0, 0]
string = input()
cmd = []
j1 = 0
while True:
if string[j1].isalpha():
cmd.append(string[j1])
else:
for k in range(len(string), j1, -1):
if string[j1:k].isdigit():
cmd.append(string[j1:k])
j1 = k-1
break
j1 += 1
if j1 >= len(string):
break
string1 = string
digit = string1.replace('L', ' ').replace('R', ' ').split()
x = 0
for j in range(len(cmd)):
if cmd[j].isdigit():
cmd[j] = digit[x]
x += 1
flag = 0
for j in range(len(cmd)):
if cmd[j].isdigit():
indx[flag] += int(cmd[j])
else:
if cmd[j] == 'L':
flag += 1
if cmd[j] == 'R':
flag -= 1
distance = [indx[0] - indx[2], indx[1] - indx[3]]
ans = math.sqrt(distance[0] ** 2 + distance[1] ** 2)
print('%.2f' % ans)
思路:字符串处理和数字提取最后坐标表示
n = int(input())
a, b, c = map(int, input().split())
ans = 0
for i in range(1, n + 1):
if i % a != 0 and i % b != 0 and i % c != 0:
ans += 1
print(ans)
from datetime import *
def count_mondays(start_year, start_month, start_day, end_year, end_month, end_day):
start_date = datetime(start_year, start_month, start_day)
end_date = datetime(end_year, end_month, end_day)
count = 0
flag = start_date
while flag <= end_date:
if flag.weekday() == 0:
count += 1
flag += timedelta(days=1)
return count
start_year = 1901
start_month = 1
start_day = 1
end_year = 2000
end_month = 12
end_day = 31
ans = count_mondays(start_year, start_month, start_day, end_year, end_month, end_day)
print(ans)
思路:使用datetime模块进行时间处理