#include <iostream>
using namespace std;
int mian()
{
int n, idx = 0;
cin >> n;
int* a = new int[n];
int* odd = new int[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
if (a[i] % 2 != 0)
{
odd[idx] = a[i];
idx++;
}
}
for (int i = 0; i < idx - 1; i++)
{
for (int j = 0; j < idx - i - 1; j++)
{
if (odd[j] > odd[j + 1])
{
int temp = odd[j];
odd[j] = odd[j + 1];
odd[j + 1] = temp;
}
}
}
for (int i = 0; i < idx; i++)
{
cout << odd[i] << endl;
}
return 0;
}
怎么办?
求大神们帮忙!