0
已解决
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
double a[20001];
int main(){
int n;
cin>>n;
double t;
for(int i=1;i<=n;i++){
cin>>t;
a[(int)t]++;
}
for(double i=1;i<=n;i++){
for(int j=1;j<=a[(int)i];j++){
cout<<i<<endl;
}
}
return 0;
}
哪里错了
0
已采纳
你可以用sort,这样会比较简单一些,
if(自己想){
return 自己想>自己想;
}
return x<y;
给你一个判断的地方
sort(a+自己想,a+自己想,cmp);
这是sort,其中cmp是判断的定义名
望采纳,谢谢
0
0
0
0
0
0

