Cod sursa(job #1411768)

Utilizator jurjstyleJurj Andrei jurjstyle Data 31 martie 2015 22:21:02
Problema Sortare prin comparare Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.52 kb
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>

using namespace std ;

ifstream f ("algsort.in") ;
ofstream g ("algsort.out") ;

// Intro Sort
vector<int> V ;

int main ()
{
    register int n , x ;

    f >> n ;

    for ( int i = 0 ; i < n ; ++i )
        {
         f >> x ;
         V.push_back(x) ;
        }

    sort ( V.begin() , V.end() ) ;

    for ( vector<int> :: iterator I = V.begin() ; I != V.end() ; ++I )
        g << *I << " " ;

    return 0 ;
}