#include<stdio.h>
#include<functional>
#include<queue>
#include<vector>
using namespace std;
struct cmp
{
bool operator ()(double &a,double &b)
{
return a<b;
}
};
double a[]=
{
12.3,
34.5,
9.5,
2.4,
6.8,
7.0,
33.6
};
int main()
{
priority_queue<double,vector<double>,cmp> q;for(int i=0;i < 7;i++)
{
q.push(a[i]);
}
while(!q.empty())
{
printf("%.1lf \n",q.top());
q.pop();
}
return 0;
}
/********
34.5
33.6
12.3
9.5
7.0
6.8
2.4
请按任意键继续. . .
*****/
11-13