#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
bool compas( const int &a, const int &b)
{
return a>b;
}
int main()
{
typedef vector<int> int_vector;
typedef istream_iterator<int> in_istream_iterator;
typedef ostream_iterator<int> out_ostream_iterator;
typedef back_insert_iterator<vector<int> > back_iterator;
int_vector myint;
copy(in_istream_iterator(cin),in_istream_iterator(),back_iterator(myint));
sort(myint.begin(),myint.end(),compas);
copy(myint.begin(),myint.end(),out_ostream_iterator(cout,"\n"));
return 0;
}
STL应用之输入任意个整数,并按从大到小排序并输入
最新推荐文章于 2021-12-26 20:39:31 发布