遍历输入的字符串的所有单词,然后判断是否符合删除条件,如果不符合就累加到一个空字符串,如果符合就pass,最后输出累加的字符串就是删除后的字符串
words = input().replace("-","").split()
res = []
for i in words:
if i.isalpha():
res.append(i)
elif i.startswith(("@","#")):
continue
elif i.endswith("..."):
res.append(i[:-3])
else:
w = ""
for j in i:
if j.isdigit():
continue
w += j
res.append(w)
print(" ".join(res))