#qew ewr rewf gsd dgfd fdgf
count = 0
index = 0
str = input()
str1 = str.strip()
while index < len(str1):
if str1[index] != " ":
index += 1
else:
count += 1
index += 1
print(count+1)
'''str.strip('序列‘)
其中,序列是一段字符串,
该函数表示从头或者从尾部开始进行扫描,
如果扫描的字符在序列字符串中,则剔除掉,
一直到遇到一个不在序列字符串中的字符为止。'''
求单词个数
最新推荐文章于 2024-01-05 17:00:35 发布