"简简单单"
2025-07-30 11:36:43
发布于:四川
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
struct a{
int boy[205]={};
int girl[205]={};
}s;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
int shu;
cin>>shu;
if(shu>0) s.boy[shu];
else if(shu<0) s.girl[-shu];
}
for(int i=0;i<204;i++){
for(int j=1;j<=s.boy[i];j++){
cout<<i<<" ";
}
}
for(int i=204;i>=0;i--){
for(int j=1;j<=s.girl[i];j++){
cout<<"-"<<i<<" ";
}
}
return 0;
}
这里空空如也
有帮助,赞一个