Cod sursa(job #1519846)
| Utilizator | Data | 7 noiembrie 2015 22:11:23 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.54 kb |
#include <cstdio>
#include <algorithm>
using namespace std;
FILE *f = fopen ( "sort.in" , "r" ) , *g = fopen ( "sort.out" , "w" );
const int MAX = 500005;
int Size , myInts [ MAX ] , i;
void read()
{
fscanf ( f , "%d" , &Size );
for ( i = 1 ; i <= Size ; i ++ )
fscanf ( f , "%d" , &myInts [ i ] );
}
void print()
{
for ( i = 1 ; i <= Size ; i ++ )
fprintf ( g , "%d " , myInts [ i ] );
}
int main()
{
read();
sort ( myInts + 1 , myInts + Size + 1 );
print();
return 0;
}
