📜  如何在 C++ 代码示例中循环一组对

📅  最后修改于: 2022-03-11 14:44:46.090000             🧑  作者: Mango

代码示例1
for (set >:: iterator it = a.begin(); it != a.end();/* blank */)
{
    cout << it->first << " " << it->second << endl;
    if (freq[it->first] == 1 || freq[it->second] == 1)
    {
        it = a.erase(it);
          removed = true;
    }
    else
    {
        ++it;
    }
  
}