#include <stdio.h> // 升序: void Ascending(int a[], int b) { while (b--) { for (int j = 0; j < b; j++) { if (a[j] > a[j + 1]) { int temp = a[j + 1]; a[j + 1] = a[j]; a[j] = temp; } } } } // 降序: void Decending(int a[], int b) { while (b--) { for (int j = 0; j < b; j++) { if (a[j] < a[j + 1]) { int temp = a[j + 1]; a[j + 1] = a[j]; a[j] = temp; } } } } int main() { int n = 10; int Arr[n]; int Brr[n]; int Crr[n]; int Drr[n]; for (int i = 0; i < 10; i++) { scanf("%d", &Arr[i]); } int j = 0; int k = 0; int l = 0; while (n--) { if (Arr[j] % 2 != 0) { Brr[k++] = Arr[j]; j++; } else { Crr[l++] = Arr[j]; j++; } } Decending(Brr, k); Ascending(Crr, l); for (int m = 0; m < l; m++) { Brr[k++] = Crr[m]; } for (int p = 0; p < k; p++) { printf("%d ", Brr[p]); } printf("\n"); return 0; }