Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41347 | 老方 | 奇数单增序列 | C++ | Accepted | 0 MS | 252 KB | 287 | 2024-02-20 18:00:34 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int j[n],ji=0; for(int i=0;i<n;i++){ int temp; cin>>temp; if(temp%2)j[ji++]=temp; } sort(j,j+ji); for(int i=0;i<ji;i++){ if(i==ji-1)cout<<j[i]; else cout<<j[i]<<','; } return 0; }