package com.edu.hhxy;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
/**
* @author five-five
* @created 2021/10/13-21:07
*/
public class Demo07 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
List<Integer> j = new ArrayList<>();
List<Integer> o = new ArrayList<>();
int a = 10;
while (a-- > 0) {
int num = scanner.nextInt();
if (num % 2 == 0) {
o.add(num);
} else {
j.add(num);
}
}
j.sort(new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
return o2 - o1;
}
});
o.sort(new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
return o1 - o2;
}
});
StringBuilder stringBuilder = new StringBuilder();
for (Integer integer : j) {
stringBuilder.append(integer).append(" ");
}
for (Integer integer : o) {
stringBuilder.append(integer).append(" ");
}
System.out.println(stringBuilder.substring(0, stringBuilder.length() - 1).toString());
}
}
0.0分
0 人评分