Cod sursa(job #1892750)

Utilizator StarGold2Emanuel Nrx StarGold2 Data 25 februarie 2017 11:29:14
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.38 kb
#include <bits/stdc++.h>
using namespace std;

fstream in ( "algsort.in" , ios::in  );
fstream out( "algsort.out", ios::out );

vector<int> arr;

int main( void ) {
    
    int n;
    in >> n;
    
    arr.resize( n );
    for( int &x : arr )
        in >> x;
    
    sort( arr.begin(), arr.end() );
    
    for( int &x : arr )
        out << x << " ";
    out << endl;
    
    return 0;
}