Cod sursa(job #1418173)
Utilizator | Data | 12 aprilie 2015 11:00:18 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.33 kb |
#include <fstream>
#include <algorithm>
using namespace std;
ifstream fin("algsort.in");
ofstream fout("algsort.out");
int main()
{
unsigned int n,i,a[500001];
fin>>n;
for(i=1; i<=n; i++) fin>>a[i];
fin.close();
sort(a+1,a+n+1);
for(i=1; i<=n; i++) fout<<a[i]<<' ';
fout.close();
return 0;
}