Pagini recente » Cod sursa (job #676380) | Cod sursa (job #2692950) | Cod sursa (job #2990181) | Cod sursa (job #1584430) | Cod sursa (job #2381625)
#include <bits/stdc++.h>
using namespace std;
int n, i, h[500005], k;
/*
void dHeap (int poz)
{
while (poz*2<=k) {
int st=2*poz;
if (h[st]<h[st+1] && st+1<=k)
st=st+1;
if (h[poz]<h[st]) {
swap(h[st], h[poz]);
poz=st;
}else
break;
}
}*/
int main () {
ifstream fin ("algsort.in");
ofstream fout ("algsort.out");
fin>>n;
for (i=1;i<=n;i++) {
fin>>h[i];
}
sort(h+1, h+n+1);
for (i=1;i<=n;i++) {
fout<<h[i]<<" ";
}
return 0;
}