Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道如何使用 strtok() 函数标记字符串。现在我将数据保存在链表中。如果我使用 cin.ignore 从用户那里获取输入,我将如何将输入的单词与我喜欢的列表中的数据进行比较。PS:概念是开发一个搜索引擎。
std::set
your_set.find
顺便说一句,我怀疑这对搜索引擎会有多大好处,除了(可能)用于停止列表 - 确定当前单词是否是您想要忽略的单词。例如,建立一个“a”、“an”、“the”等不值得索引的列表,当你索引某些东西时,检查它是否在最后一个(如果是,显然忽略它) .