Cod sursa(job #239875)
Utilizator | Data | 6 ianuarie 2009 00:20:36 | |
---|---|---|---|
Problema | Sortare prin comparare | Scor | Ascuns |
Compilator | cpp | Status | done |
Runda | Marime | 0.46 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 = 0; i < N; i++ )
printf( "%d ", V[i] );
return 0;
}