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