Pagini recente » Cod sursa (job #2036921) | Cod sursa (job #236536) | Cod sursa (job #1250210) | Cod sursa (job #1846445) | Cod sursa (job #2591387)
#include <bits/stdc++.h>
using namespace std;
class cmp {
public:
bool operator () (const int &a, const int &b) {
return a>b;
}
};
int main () {
ifstream fin ("algsort.in");
ofstream fout ("algsort.out");
priority_queue <int, vector <int>, cmp> PQ;
int n, x;
for (fin >> n; n; n--) {
fin >> x;
PQ.push(x);
}
while (!PQ.empty()) {
fout << PQ.top() << ' ';
PQ.pop();
}
return 0;
}