Cod sursa(job #240473)
| Utilizator | Data | 7 ianuarie 2009 18:29:51 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <stdio.h>
#include <algorithm>
#define Nmax 500001
using namespace std;
int V[Nmax],N;
void read_data()
{
int i;
freopen("algsort.in","r",stdin);
scanf("%d", &N);
for (i=1;i<=N;++i)
scanf("%d", &V[i]);
}
void write_data()
{
int i;
freopen("algsort.out","w",stdout);
sort(V+1,V+N+1);
for (i=1;i<=N;++i)
printf("%d ", V[i]);
}
int main()
{
read_data();
write_data();
return 0;
}
