Package sort中Ints的用法
func Ints
func Ints(a []int)
Ints sorts a slice of ints in increasing order
例子:
package main
import (
"fmt"
"sort"
)
func main() {
s := []int{5, 2, 6, 3, 1, 4} // unsorted
sort.Ints(s)
fmt.Println(s)
}
func Ints(a []int)
Ints sorts a slice of ints in increasing order
例子:
package main
import (
"fmt"
"sort"
)
func main() {
s := []int{5, 2, 6, 3, 1, 4} // unsorted
sort.Ints(s)
fmt.Println(s)
}