Cod sursa(job #300285)
| Utilizator | Data | 7 aprilie 2009 12:44:12 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
#define pb push_back
#define sz size
vector<int> v;
int n,x;
int main()
{
int i;
freopen("algsort.in","r",stdin);
freopen("algsort.out","w",stdout);
scanf("%d", &n);
for (i=1;i<=n;++i)
{
scanf("%d", &x);
v.pb(x);
}
sort(v.begin(),v.end());
for (i=0;i<v.sz();++i)
printf("%d ", v[i]);
return 0;
}