Cod sursa(job #2418231)

Utilizator ALEx6430Alecs Andru ALEx6430 Data 4 mai 2019 13:35:09
Problema Sortare prin comparare Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.4 kb
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

ifstream in("algsort.in");
ofstream out("algsort.out");

int main()
{
    int n;
    in >> n;

    vector<int> v;
    for(int i = 0; i < n; i++)
    {
        int tmp;
        in >> tmp;
        v.push_back(tmp);
    }

    sort(v.begin(),v.end());

    for(auto it: v) out << it << ' ';

    return 0;
}