python统计sys.stdin中单词数的脚本

import sys

text = sys.stdin.read()

words = text.split()

wordcount = len(words)

print 'wordcount:',wordcount

 

posted on 2013-02-22 11:17  语辰  阅读(109)  评论(0编辑  收藏  举报