#include <iostream>
#include <queue>
using namespace std;
int main ()
{
priority_queue <int> pq;
int i,val;
for(i=0;i<10;i++)
{
cin>>val;
pq.push(val);
}
while(!pq.empty())
{
cout<<pq.top()<<endl;
pq.pop();
}
return 0;
}
#include <queue>
using namespace std;
int main ()
{
priority_queue <int> pq;
int i,val;
for(i=0;i<10;i++)
{
cin>>val;
pq.push(val);
}
while(!pq.empty())
{
cout<<pq.top()<<endl;
pq.pop();
}
return 0;
}
No comments:
Post a Comment