function swap(&$m,&$n)
{
 $temp = $n;
 $n = $m;
 $m = $temp;
}function QuickSort(&$b,$l,$r)
{
 $i = $l;$j = $r;
 $x = $b[($i+$j)/2];
 do{
  while (($b[$i]>$x)&&($i<$r))$i++;
  while (($b[$j]<$x)&&($j>$l))$j--;
  if($i <= $j) swap($b[$j--],$b[$i++]);
 }
 while ($i<=$j);
 if($l<$j) QuickSort(&$b,$l,$j);
 if($i<$r) QuickSort(&$b,$i,$r);
}
QuickSort($a,0,count($a)-1);快速排序