📅  最后修改于: 2022-03-11 14:45:30.632000             🧑  作者: Mango
with open("file.txt") as f:
out = []
for line in f:
for word in line.split():
out.append(word)
if word.endswith(('.', '!')):
print(' '.join(out)+'\n')
out.clear()