Problem

8/8

向量排序

Problem

按元素的非递减顺序对数组进行排序。为此,您需要为变量 a 和 b 设置正确的值。

<正文>
(c) Grigoriev E., 2018
输入 输出
<分区> 6 <分区> -1 5 1 3 7 6 -1 1 3 5 6 7
Write the program below
#include <algorithm>
#include <iterator>
#include <iostream>
#include <vector>
using namespace std;

int n;
vector<int>Array(0);
vector<int>::iterator a, b;

int main() {
    cin >> n;
    Array.resize(n);
    for (int i = 0; i < Array.size(); i++)
        cin >> Array.at(i);     
    

   sort(a, b);

    for (int i = 0; i < Array.size(); i++)
        cout << Array.at(i) << " ";
}     

     

Program check result

To check the solution of the problem, you need to register or log in!