0
如何查找映射中两个键值之间的键数?有什么办法可以使用迭代器来完成这个任务吗?两个键之间的键数
如何查找映射中两个键值之间的键数?有什么办法可以使用迭代器来完成这个任务吗?两个键之间的键数
看一看地图和一些STL algirhtims:
http://www.cplusplus.com/reference/stl/map/
lower_bound Return iterator to lower bound (public member function)
upper_bound Return iterator to upper bound (public member function)
distance Calculates the number of elements between first and last.
我没有使用过的地图迭代不够了解,但'的std :: distance'威力。 – chris
你有没有对此进行过解析,@ user1543957?如果是这样,这将有助于知道你到目前为止尝试过什么。使用此[编辑]链接添加更多详细信息。祝你好运! – jmort253