Pagini recente » Cod sursa (job #2608743) | Cod sursa (job #1743417) | Cod sursa (job #2274) | Cod sursa (job #2939714) | Cod sursa (job #692784)
Cod sursa(job #692784)
// problema sortare, arhiva educationala, varianta C
# include <algorithm>
# include <cstdio>
using namespace std;
# define verf ++poz == hg ? fread ( ch, 1, hg, stdin ), poz = 0 : 0
const char *FIN = "algsort.in", *FOU = "algsort.out";
const int MAX = 500001, hg = 1 << 13;
int N, poz, A[MAX];
char ch[hg];
inline void cit ( int &x ) {
if ( ch[0] == '\0' ) fread ( ch, 1, hg, stdin ) ;
else for ( ; ch[poz] < '0' || ch[poz] > '9' ; verf ) ;
for ( x = 0 ; ch[poz] >= '0' && ch[poz] <= '9' ; x = x * 10 + ch[poz] - '0', verf ) ;
}
int main (void) {
freopen (FIN, "r", stdin);
freopen (FOU, "w", stdout);
cit (N);
for (int i = 0; i < N; ++i)
cit (A[i]);
sort (A, A + N);
for (int i = 0; i < N; ++i)
printf ("%d ", A[i]);
}