0
已解决
钱思源
高级天翼
高级天翼
题目链接: 酷町堂:3977
错误代码:
#include<iostream>
#include<algorithm>
using namespace std;
int n;
double a[20005];
bool cmp(double x,double y){
if(x-1.0!=y-1.0)return x-1.0>y-1.0;
return x<y;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++){
cout<<a[i]<<" ";
}
return 0;
}
0
0
0
0
0
0
0
0
0