design.txt
来自「为什么这个网站要弄这么麻烦啊??真是搞不明白」· 文本 代码 · 共 2 行
TXT
2 行
first of all, create a new Tokenizer, which will prompt to input a sentence, then call the nextWord function of it to get each word in the sentence, save them to list1. to count and output the number of words in list1, just output the size of list1. secondly, construct a loop to check every word in list1, find out those begin with a consonant, delete from list1 and add into list2.
output size of list2. thirdly, insert each word of list2 to a BinarySearchTree, with the word as the key, the times of word appeared in the list as the element. if there are same word, just insert once, and record the times of the word appeared in the node. then, traverse the tree, output the keys and the elements of the tree. the number of different word is the size of the search tree.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?