📅  最后修改于: 2022-03-11 14:44:57.244000             🧑  作者: Mango
#include
#include
void print_queue(std::queue q)
{
while (!q.empty())
{
std::cout << q.front() << " ";
q.pop();
}
std::cout << std::endl;
}
int main()
{
std::queue q;
for (auto i : {1,2,3,7,4,9,7,2,4}) q.push(i);
print_queue(q);
}