陈朋飞


私信TA

用户名:fgzsfgzs

访问量:7812

签 名:

等  级
排  名 161
经  验 6898
参赛次数 0
文章发表 73
年  龄 21
在职情况 学生
学  校 南昌工程学院
专  业 通信 兼修 计算机

  自我简介:

欢迎加我QQ进行交流:2148491591,本人 C语言,C++,JAVA都会一点

解题思路:

注意事项:

参考代码:

#include<vector>

#include<iostream>

#include<string>

#include<algorithm>

#include<cmath>

#include<cstdio>

#include<deque>

using namespace std;

int main()

{

deque<int>s;

int n;

cin >> n;

while (n--)

{

for (int i = 0; i < 9; i++)

{

int a;

cin >> a;

s.push_back(a);

}

deque<int>::iterator it1 = s.begin();

int t = *it1;

int m = s.size();

for(int i=0;i<m;i++)

if (s.at(i) < t)

{

int m = s.at(i);

s.erase(s.begin()+i);

s.push_front(m);

}

deque<int>::iterator it = s.begin();

for (int i = 0; it != s.end(); i++, it++)

if (i == 8)

cout << *it << endl;

else

cout << *it << " ";

s.clear();


}

return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区