文章
33
粉丝
78
获赞
3
访问
18.4k
#include <stdio.h>
#include <algorithm>
#include <iostream>
using namespace std;
bool asc(int a, int b) {
return a < b;
}
int main() {
int n;
int num[100];
cin >> n ;
for (int i = 0;i < n;i++) {
cin >> num[i];
}
sort(num,num + n,asc);
for (int i = 0;i < n;i++) {
if (num[i] % 2 == 1) {
cout << num[i] << " ";
}
}
for (int i = 0;i < n;i++) {
if (num[i] % 2 == 0) {
cout << num[i] << " ";
}
&nbs...
登录后发布评论
暂无评论,来抢沙发