#includeusing namespace std; int main() { int a[10]; while (cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4] >> a[5] >> a[6] >> a[7] >> a[8] >> a[9]) { int count = 0; for (int i = 0; i < 10; i++) { if (a[i] % 2 != 0) { for (int j = count; j < i; j++) { if (a[j] % 2 == 0) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } } count++; } }//把奇数都放在前面 for (int i = 0; i < count-1; i++) { for (int j = 0; j < count - 1 - i; j++) { if (a[j] < a[j + 1]) { int t = a[j]; a[j] = a[j + 1]; a[j + 1] = t; } } } for (int i = count; i <9; i++) { for (int j = count; j < 9 - i+count; j++) { if (a[j] > a[j + 1]) { int t = a[j]; a[j] = a[j + 1]; a[j + 1] = t; } } } for (int i = 0; i < 10; i++) { cout << a[i] << " "; } cout << endl; } }



