38

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <list>
using namespace std;
int main()
{    
    double a[] = {1.2,3.4,9.8,7.3,2.6};
    list<double> lst(a,a+5);
    lst.sort(greater<double>());  
    for(list<double>::iterator i  = lst.begin(); i != lst.end(); ++i) 
        cout << * i << "," ;
    return 0;
}

 

posted @ 2022-11-23 20:24  balabalahhh  阅读(103)  评论(0编辑  收藏  举报