#include #include using namespace std; void reducirCola(queue &c); int main(){ queue c; c.push(1); c.push(1); c.push(1); c.push(2); c.push(2); c.push(2); c.push(3); c.push(3); c.push(3); reducirCola(c); while (!c.empty()){ cout << c.front() << endl; c.pop(); } return 0; } void reducirCola(queue &c){ queue q; int x, y, z; if (!c.empty()){ x = c.front(); c.pop(); q.push(x); while (!c.empty()){ y = c.front(); c.pop(); if (x != y){ q.push(y); x = y; } } } while (!q.empty()){ z = q.front(); q.pop(); c.push(z); } }