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.
我需要打印列表中每个块对的第二个元素。任何指导将不胜感激,请帮助?
列表中的每个迭代器都指向一个 类型的对象std::pair<int, int>。为了使用迭代器打印 pair 对象中的第二个元素,itr请执行以下操作:
std::pair<int, int>
itr
std::cout << itr->second;