文章
55
粉丝
100
获赞
12
访问
31.1k
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
bool cmp(int a,int b){
if(a%2!=b%2){
return a%2>b%2;
}else{
if(a%2==1){
return a>b;
}else{
return a<b;
}
}
}
int main(){
int a[11];
while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]>>a[7]>>a[8]>>a[9]){
sort(a,a+10,cmp);
for(int i = 0; i<10; i++){
cout<<a[i]<<" ";
}
cout<<endl;
}
}
登录后发布评论
暂无评论,来抢沙发