param($list)
write "Before sorting"
write "$list"
$len = $list.Count
foreach ($i in $list) {
foreach ($j in @(0..($len -2))) {
if ($list[$j] -gt $list[$j 1]) {
$list[$j],$list[$j 1] = $list[$j 1],$list[$j]
}
}
}
write $("-" * 3)
write "After sorting"
return $list
}
$newlist = @(1..20) | Get-Random -Count 10
write "$(Sort-List $newlist)"
更多關于云服務器,域名注冊,虛擬主機的問題,請訪問三五互聯官網:m.shinetop.cn