Pagini recente » Cod sursa (job #2662557) | Cod sursa (job #1652710) | Cod sursa (job #1210427) | Cod sursa (job #2359811) | 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;
}