Cod sursa(job #641805)
| Utilizator | Data | 29 noiembrie 2011 17:12:16 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.4 kb |
#include <algorithm>
#include <fstream>
#include <list>
using namespace std;
list <int> V;
int N;
int main ()
{
ifstream fin ("algsort.in");
ofstream fout ("algsort.out");
fin>>N;
for (int i=0; i<N; ++i)
{
int x;
fin>>x;
V.push_back (x);
}
sort (V.begin (),V.end ());
for (int i=0; i<N; ++i)
{
fout<<*(V.begin ())<<" ";
V.pop_front ();
}
return 0;
}