这格式问题是真害人呀,我搞不懂,有大佬会吗

#include <cstdio>

#include <cctype>

#include <cstring>

#include <cmath>

#include <cstdlib>

#include<iostream>

#include<bits/stdc++.h>

using namespace std;

int main() {

// freopen("a.in", "r", stdin);

// freopen("a.out", "w", stdout);

int n;

while(cin>>n){

queue<int>a;

for(int i=1;i<=n;i++){

int k;

cin>>k;

a.push(k);

}

int po;

cin>>po;

int flag=0;

for(int i=1;i<=n;i++){

int k=a.front();

a.pop();

if(k!=po||(k==po&&flag==1)){

a.push(k);

} else{

flag=1;

}

}

while(!a.empty()){

int k=a.front();

a.pop();

if(a.size()==0){

cout<<k;

}else{

cout<<k<<" ";

}

}

}

return 0;

}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-07 11:20
点赞 评论 收藏
分享
这是什么操作什么意思,这公司我服了...
斯派克spark:意思是有比你更便宜的牛马了
点赞 评论 收藏
分享
06-20 17:42
东华大学 Java
凉风落木楚山秋:要是在2015,你这简历还可以月入十万,可惜现在是2025,已经跟不上版本了
我的简历长这样
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-11 17:10
什么素质,我请问呢,要掉小珍珠了。。。又憋屈又生气
Steven267:这不喷回去?花钱是大爷,记住这个道理
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务