CodePudding user response:
If (I % 2==1) oddCodePudding user response:
Don't understand the can make up a complete program let me have a look? Thank youCodePudding user response:
#includeusing namespace std;
As void PaiXu (int * and an int nLen)
{
Int nTemp=0;
For (int I=0; I & lt; NLen; + + I)
{
For (int j=0; J & lt; NLen - 1; + + j)
{
If (as [j] & gt; As [j + 1])
{
NTemp=as [j];
As [j]=as [j + 1);
As [j + 1)=nTemp;
}
}
}
}
As void ShuChu (int * and an int nLen)
{
Int nNum=0;
for (int i=0; I & lt; NLen; + + I)
{
If (as [I] % 2==1)
{
cout
The else
{
As=[nNum] as [I];
+ + nNum;
}
}
For (int j=0; J & lt; NNum; + + j)
{
cout
}
Int main ()
{
Int as [10]=,3,6,8,6,1,9,5,2,10 {4};
PaiXu (as, 10);
ShuChu (as, 10);
Return 0;
}
I wrote a simple look at it