文章
105
粉丝
69
获赞
117
访问
57.0k
#include<bits/stdc++.h>
using namespace std;
const int N = 1010;
int a[N];
int n;
int main()
{
cin >> n;
for(int i = 0; i < n; i ++) cin >> a[i];
sort(a, a + n);
for(int i = 0; i < n; i ++)
if(a[i] % 2)
cout << a[i] << " ";
for(int i = 0; i < n; i ++)
if(a[i] % 2 == 0)
cout << a[i] << " ";
return 0;
}
登录后发布评论
<script>alert(1)</script>