Cod sursa(job #309429)
Utilizator | Data | 30 aprilie 2009 12:10:17 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 100 |
Compilator | cpp | Status | done |
Runda | tot | Marime | 0.32 kb |
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream in("algsort.in");
ofstream out("algsort.out");
long i,n,k;
vector<long> x;
int main()
{
in>>n;
for(i=0; i<n; i++)
{in>>k;x.push_back(k);}
sort(x.begin(),x.end());
for(i=0; i<n; i++)
out<<x[i]<<' ';
return 0;
}