Cod sursa(job #338817)
| Utilizator | Data | 6 august 2009 23:30:05 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.38 kb |
#include <fstream>
#define Max 500001
using namespace std;
ifstream f("algsort.in");
ofstream g("algsort.out");
int n,v[Max];
void citire ()
{
f>>n;
for (int i=1; i<=n; i++)
f>>v[i];
f.close ();
}
void afisare ()
{
for (int i=1; i<=n; i++)
g<<v[i]<<" ";
g.close ();
}
int main ()
{
citire ();
sort (v+1,v+n+1);
afisare ();
return 0;
}
