#30781: python 參考


logoutblank (LogOut)


while True:
    try:
        sentence = str(input())
    except EOFError:
        break
    newstring = ""

//排除所有不是字母的狀況 for i in range(0, len(sentence)): if sentence[i].isspace() or sentence[i].isalpha(): newstring += sentence[i] else: newstring += " "
word_count = newstring.split() print(len(word_count))