| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 142246 | Kevin | 【一维数组】排序后的奇数项 | C++ | Accepted | 0 MS | 272 KB | 346 | 2026-01-02 13:47:01 |
#include<bits/stdc++.h> using namespace std; int main(){ int a[30]; for(int i=1;i<=20;i++){ cin>>a[i]; } for(int i=1;i<20;i++){ for(int j=i+1;j<=20;j++){ if(a[i]>a[j]){ int t=a[i]; a[i]=a[j]; a[j]=t; } } } cout<<a[1]; for(int i=2;i<=20;i++){ if(i%2){ cout<<" "<<a[i]; } } return 0; }