文章
28
粉丝
0
获赞
60
访问
1.6k
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin>>n){
vector<int> lst;
while(n--){
int temp;
cin>>temp;
lst.push_back(temp);
}
sort(lst.begin(),lst.end()); //默认升序,如果要降序可以写一个bool cmp(int a,int b)函数,
//然后return a>b; ,放到sort函数的第三位.
for(auto it:lst) cout<<it<<" ";
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发