Cod sursa(job #540509)
Utilizator | Pitis Daniel-Florin daniel.florin | Data | 24 februarie 2011 00:05:01 |
---|---|---|---|
Problema | Sortare prin comparare | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
vector <int> V;
int main()
{
int i, x, N;
freopen("algsort.in","r",stdin);
freopen("algsort.out","w",stdout);
scanf("%d",&N);
for(i=1; i<=N; ++i)
{
scanf("%d",&x);
V.push_back(x);
}
sort(V.begin(),V.end());
for(i=1; i<=N; ++i)
printf("%d ",V[i]);
return 0;
}