所以我使用这段代码对一个数字数组进行排序,但它给了我一个错误,我需要一个“}”。我错过了一些“}”吗?任何帮助,将不胜感激!
double Median()
{
int k,Hide;
boolean IsThereASwap;
IsThereASwap = false;
while(IsThereASwap == false )
{
for ( k = 0 ; k < TheArrayAssingment.length - 1; k++)
{
if( TheArrayAssingment[k] > TheArrayAssingment[k+1] )
{
Hide = TheArrayAssingment[k+1];
TheArrayAssingment[k+1] = TheArrayAssingment[k];
TheArrayAssingment[k] = Hide;
IsThereASwap = true;
}
}
if ( IsThereASwap == true)
{
IsThereASwap = false;
}
else
{
IsThereASwap = true;
}
}
}