We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
from Volume 1. Elementary Problem Solving :: String
8岁的小 Andy 想要自己写一本字典,但是他认识的字不太多。于是他就将他最喜欢的一个故事里面的单词,整理成一本字典。单个或多个连续的字母算作一个单词,所有单词在字典中都小写。且字典按字典序排序(废话)。
相当于读一篇文章,找出其中的所有单词并且按字典序排序输出。可以利用 STL 中的 set。找到单词即插入 set 中,则 set 自动排序这些单词。最后通过迭代器按顺序输出单词即可。