Cod sursa(job #3333150)

Utilizator TonyyAntonie Danoiu Tonyy Data 11 ianuarie 2026 14:42:02
Problema Sortare prin comparare Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.47 kb
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

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

vector<int> v;

int main() {
    ios::sync_with_stdio(false);

    int n;
    fin >> n;
    for(int i = 0, x; i < n; i++) {
        fin >> x;
        v.push_back(x);        
    }
    sort(v.begin(), v.end());
    for(const int& i: v) {
        fout << i << " ";
    }

    fin.close();
    fout.close();
    return 0;
}