下面的 C++ 用于对 lstA 排序,使得偶数在前奇数在后,横线处应填入( )。
bool isEven(int N)
{
return N % 2 == 0;
}
void swap(int &a, int &b)
{
int t;
t=a,a=b,b=t;
return;
}
void sortA(int lstA[], int n)
{
int i, j, t;
for (i = n-1; i > 0; i--)
for(j = 0; j < i; j++)
if(____________)
swap(lstA[j], lstA[j+1]);
return;
}
- A.
!isEven(lstA[j]) && isEven(lstA[j+1]) - B.
isEven(lstA[j]) && !isEven(lstA[j+1]) - C.
lstA[j] > lstA[j+1] - D.
lstA[j] < lstA[j+1]