| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 159390 | 张晓冉 | 选择排序-函数 | C++ | Wrong Answer | 1 MS | 268 KB | 298 | 2026-08-29 14:54:14 |
#include<bits/stdc++.h> using namespace std; bool cmp(int x,int y){ return y > x; } int main(){ int n; cin>>n; int a[n] = {0}; for(int i = 0;i < n;i++){ cin>>a[i]; } sort(a,a + 10,cmp); for(int i = 0;i <= 9;i++){ cout<<a[i]<<' '; } }
------Input------
20 1 3 5 7 9 10 6 4 2 8 21 23 19 30 17 13 18 90 28 14
------Answer-----
1 2 3 4 5 6 7 8 9 10 13 14 17 18 19 21 23 28 30 90
------Your output-----
1 2 3 4 5 6 7 8 9 10