作者asyhuang (Yes, Taiwan)
看板perl
标题[问题] Perl 用来算所有字出现的次数会不会很难写?
时间Thu Apr 8 09:41:52 2004
我想试看看用perl做这个问题...
是不是 mix shell script 或用其它写会比较快? C/C++当然可以做到,
但只用 perl 可以快一点吗?
produce a count of all the different "words" in a text file.
Use any definition of word that makes logical sense or makes your job easy.
The output might look like this:
17 a
14 the
9 of
9 in
8 com
7 you
7 that
7 mercedsystems
6 to
...
For this input file, the word "a" occurred 17 times, "the" 14 times,
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 63.205.69.67