版本一:正常写
版本二:改成函数形式了
#版本1
text = []
inp = []
total = 0
while True:
st = input()
while "<" in st:
index = st.find("<")
if index != 0:
st = st[0:index-1]+st[index+1:]
else:
st = st[1:]
if st == "EOF":
break
text.append(list(st))
while True:
st = input()
while "<" in st:
index = st.find("<")
if index != 0:
st = st[0:index-1]+st[index+1:]
else:
st = st[1:]
if st == "EOF":
break
inp.append(list(st))
time = int(input())
minn = time/60
for i in range(min(len(text),len(inp))):
for j in range(min(len(text[i]),len(inp[i]))):
if text[i][j] == inp[i][j]:
total +=1
print(round(total/minn))
#round(number,digits)保留number四舍五入到第digits位
#版本2
def fun(res):
while True:
st = input()
while "<" in st:
index = st.find("<")#如果同时有多个<,st.find会返回找到的第一个<的下标
if index != 0:
st = st[0:index-1]+st[index+1:]
else:
st = st[1:]
if st == "EOF":
break
res.append(list(st))
if __name__ == "__main__":
text = []
inp = []
total = 0
fun(text)
fun(inp)
time = int(input())
minn = time/60
for i in range(min(len(text),len(inp))):
for j in range(min(len(text[i]),len(inp[i]))):
if text[i][j] == inp[i][j]:
total +=1
#round(number,digits)保留number四舍五入到第digits位
print(round(total/minn))