Cod sursa(job #1519848)

Utilizator jimcarterJim Carter jimcarter Data 7 noiembrie 2015 22:13:05
Problema Sortare prin comparare Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
#include <fstream>
#include <algorithm>
using namespace std;

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

const int MAX = 500005;
int Size , myInts [ MAX ] , i;

void read()
{
    f >> Size;
    for ( i = 1 ; i <= Size ; i ++ )
        f >> myInts [ i ];
}

void print()
{
    for ( i = 1 ; i <= Size ; i ++ )
        g << myInts [ i ] << " ";
}

int main()
{
    read();
    sort ( myInts + 1 , myInts + Size + 1 );
    print();
    return 0;
}