import datetime
f = open('test', 'w')
x = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
date = input()
xd = []
if len(date) > 4:
for i in range(2021, 2042):
a = datetime.date(i, int(date[:2]), int(date[3:])).weekday()
xd.append(date + '.' + str(i) + ' - ' + str(x[a]))
else:
flag = date.index('.')
a = datetime.date(i, int(date[:flag]), int(date[flag+1:])).weekday()
f.write('Date: ' + str(date) + '\n')
for i in range(len(xd)):
f.write(xd[i]+'\n')
# data = ['service', 'out', 'eom']
# data = ['service', 'goal', 'service', 'out', 'service', 'net', 'service', 'return', 'return', 'return', 'out', 'service', 'return', 'goal', 'service', 'goal', 'eom']
data = []
name_events = ['service', 'net', 'out', 'goal', 'return', 'eom']
points = [0, 0]
count_serve = 0
last_hit = 1
serve = 0
while True:
event = input().lower().strip()
if event in name_events:
data.append(event)
print('Такого события ( ' + event + ' ) нет!')
if event == 'eom':
break
for event in data:
if event == 'service':
last_hit = serve
count_serve += 1
if event == 'goal':
points[last_hit] += 1
if event == 'net':
if last_hit == 0:
points[1] += 1
points[0] += 1
if event == 'out':
if event == 'return':
last_hit = 0
if count_serve == 5:
if serve == 0:
serve = 1
print(points)
import datetime
f = open('test', 'w')
x = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
date = input()
xd = []
if len(date) > 4:
for i in range(2021, 2042):
a = datetime.date(i, int(date[:2]), int(date[3:])).weekday()
xd.append(date + '.' + str(i) + ' - ' + str(x[a]))
else:
flag = date.index('.')
for i in range(2021, 2042):
a = datetime.date(i, int(date[:flag]), int(date[flag+1:])).weekday()
xd.append(date + '.' + str(i) + ' - ' + str(x[a]))
f.write('Date: ' + str(date) + '\n')
for i in range(len(xd)):
f.write(xd[i]+'\n')
# data = ['service', 'out', 'eom']
# data = ['service', 'goal', 'service', 'out', 'service', 'net', 'service', 'return', 'return', 'return', 'out', 'service', 'return', 'goal', 'service', 'goal', 'eom']
data = []
name_events = ['service', 'net', 'out', 'goal', 'return', 'eom']
points = [0, 0]
count_serve = 0
last_hit = 1
serve = 0
while True:
event = input().lower().strip()
if event in name_events:
data.append(event)
else:
print('Такого события ( ' + event + ' ) нет!')
if event == 'eom':
break
for event in data:
if event == 'service':
last_hit = serve
count_serve += 1
if event == 'goal':
points[last_hit] += 1
if event == 'net':
if last_hit == 0:
points[1] += 1
else:
points[0] += 1
if event == 'out':
if last_hit == 0:
points[1] += 1
else:
points[0] += 1
if event == 'return':
if last_hit == 0:
last_hit = 1
else:
last_hit = 0
if count_serve == 5:
count_serve = 0
if serve == 0:
serve = 1
else:
serve = 0
if event == 'eom':
print(points)
break