//输入10个整数,彼此以空格分隔。重新排序以后输出(也按空格分隔),要求:
//1.先输出其中的奇数,并按从大到小排列;
//2.然后输出其中的偶数,并按从小到大排列。
#include<stdio.h>
#include<algorithm>
using namespace std;
bool compare(int lhs,int rhs){
if(lhs%2==1 && rhs%2==0){ //左边奇数,右边偶数,不交换
return true;
}else if(lhs%2==1 && rhs%2==1 &&lhs>rhs){ //左边奇数,右边奇数,且左>右不交换
return true;
}else if(lhs%2==0 && rhs%2==0 && lhs<rhs){ //左边偶数,右边偶数, 且左<右,不交换
return true;
}else{ //其他情况都交换
return false;
}
}
int main(){
int arr[10];
for(int i=0;i<10;i++){
scanf("%d",&arr[i]);
}
sort(arr,arr+10,compare);
printf("%d",arr[0]);
for(int i=1;i<10;i++){
printf(" %d",arr[i]);
}
printf("\n");
return 0;
}