Cod sursa(job #404910)
| Utilizator | Data | 26 februarie 2010 21:58:30 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <cstdio>
#include <vector>
#include <fstream>
#include <algorithm>
using namespace std;
vector< int > V;
int main() {
int i, x, n;
ifstream f( "algsort.in" );
ofstream g( "algsort.out" );
f>>n;
for( i = 1; i <= n; i++ ) {
f>>x;
V.push_back( x );
}
sort( V.begin(), V.end() );
for( i = 0; i < n; i++ )
g<<V[i]<<" ";
g.close();f.close();
return 0;
}
