#include <iostream>
#include <vector>
#include <algorithm> //使用STL排序算法
using namespace std;
int main() {
int num;
vector<int> v;
for (int i = 0; i < 5; i++) {
cin >> num;
v.push_back(num);
}
// 使用 STL 排序算法对元素进行排序(从大到小)
//使用sort和reverse
sort (v.begin(),v.end());
reverse (v.begin(),v.end());
for (auto n:v){
cout << n << ' ';
}
return 0;
}

京公网安备 11010502036488号