Cod sursa(job #2578355)
Utilizator | Data | 10 martie 2020 21:50:57 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
ifstream fin("algsort.in");
ofstream fout("algsort.out");
const int NMax = 500000;
int n;
int v[NMax + 5];
int main(){
fin >> n;
for (int i = 1; i <= n; i++)
fin >> v[i];
sort(v + 1, v + n + 1);
for (int i = 1; i <= n; i++)
fout << v[i] << ' ';
fout << '\n';
return 0;
}