Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41281 jiabokai 奇数单增序列 C++ 通过 0 MS 264 KB 291 2024-02-20 11:24:39

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int a[1000],b[1000]; int main() { int n,top=0; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]%2==1){ b[top]=a[i]; top++; } } sort(b,b+top+1); for(int i=1;i<=top-1;i++){ cout<<b[i]<<","; } cout<<b[top]; }


测评信息: