//土尔逊Torson 编写于2023/4/10 #define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <stdlib.h> #include <algorithm> using namespace std; bool comp(int left, int right) { if (left % 2 == 1 && right % 2 == 0) { return true; } else if (left % 2 == 1 && right % 2 == 1 && left > right) { return true; } else if (left % 2 == 0 && right % 2 == 0 && left < right) { return true; } else { return false; } } int main() { int arr[10]; while (scanf("%d%d%d%d%d%d%d%d%d%d", arr, arr + 1, arr + 2, arr + 3, arr + 4, arr + 5, arr + 6, arr + 7, arr + 8, arr + 9) != EOF) { sort(arr, arr + 10, comp); for (int i = 0; i < 10; ++i) { printf("%d ", arr[i]); } printf("\n"); } system("pause"); return EXIT_SUCCESS; } // 64 位输出请用 printf("%lld")