题解 | #使用算法#
使用算法
https://www.nowcoder.com/practice/ba99206d258c4f96a69866bdf77162b4
#include <iostream> #include <vector> // write your code here...... #include<algorithm> using namespace std; int main() { int num; vector<int> v; for (int i = 0; i < 5; i++) { cin >> num; v.push_back(num); } // write your code here...... sort(v.begin(),v.end()); for(int i=4;i>=0;i--) { cout<<v[i]<<" "; } return 0; }