Cod sursa(job #2567476)

Utilizator NotTheBatmanBruce Wayne NotTheBatman Data 3 martie 2020 17:30:34
Problema Sortare prin comparare Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.51 kb
#include <fstream>
#include <vector>
#include <algorithm>

using namespace std;

vector <int> v;

int n, nr_scc;

void Read ()
{
    ifstream fin ("algsort.in");
    ofstream fout ("algsort.out");
    int n;
    fin >> n;
    while (n--)
    {
        int x;
        fin >> x;
        v.push_back(x);
    }
    sort(v.begin(), v.end());
    for (auto it : v)
        fout << it << " ";
    fout << "\n";
    fin.close();
    fout.close();
}

int main()
{
    Read();
    return 0;
}