标题:初学队列
取消只看楼主
酷爱陈阳
Rank: 2
等 级:论坛游民
帖 子:14
专家分:33
注 册:2014-11-1
结帖率:0
已结贴  问题点数:20 回复次数:0 
初学队列
#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
queue<int>q;
int main()
{
    int n;
    scanf("%d",&n);
    int i;
    for(i=1;i<=n;i++)
        q.push(i);
    while(!q.empty())
    {
        printf("%d ",q.front());
        q.pop();
        q.push(q.front());
        q.pop();
    }
    return 0;
}



为什么在输出正确答案后程序就停止正确运行了
搜索更多相关主题的帖子: include 
2015-01-16 18:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-441184-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.229309 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved