1个回答
展开全部
#include <queue>
int main(){
queue <int> q;
q.push(7);
q.push(5);
q.push(3);
q.push(9);
q.push(2);
q.push(4);
q.pop();
q.pop();
q.pop();
q.push15);
q.push(18);
q.push(16);
while(!q.empty()){
printf("%d\n",q.front());
q.pop();
}
return 0;
}
望采纳,谢谢
int main(){
queue <int> q;
q.push(7);
q.push(5);
q.push(3);
q.push(9);
q.push(2);
q.push(4);
q.pop();
q.pop();
q.pop();
q.push15);
q.push(18);
q.push(16);
while(!q.empty()){
printf("%d\n",q.front());
q.pop();
}
return 0;
}
望采纳,谢谢
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询