-->
当前位置:首页 > 题库

PROGRAMMING:Count words - Application

Luz5年前 (2021-05-10)题库438
We need to count the number of words in a number of paragraphs (English), and also need to count the number of times each word appears. Note 1: words are separated by spaces (one or more spaces). Note 2: ignore blank or blank lines.
requirement:
Before statistics, you need to delete the specified punctuation from the text!.,: *# And numbers from 0 to 9. Note: the so-called deletion is to replace the corresponding characters with a space.
When counting words, we need to ignore the case of words.
When the number of words is 0. Just show "0".
###Input format:
Several lines in English, ending with%%..
###Output format:
The number of words, the number of times of occurrence of the top 6 words (the number of times is sorted in descending order, if the number of times is the same, it is sorted in ascending order according to the letter of the key value) and the number of times of occurrence.
###Input example:
Here is a set of inputs. For example:
```in
Failure is probably The fortification in your pole!
It#is like a1 peek your wallet as the thief when You
are thinking how2 to. spend several hard-won lepta.
when yoU are? wondering whether new money it#has laid
background Because of: yOu5?, then at the6 heart of the
Tom say: Who is the best? No one dare to say yes.
most lax alert and! most low awareness and* left it
%%%
godsend failed it is
!!!!!
```
###Output example:
The corresponding output is given here. For example:
```out
fifty-two
the=5
is=3
it=3
you=3
and=2
are=2
```







answer:If there is no answer, please comment