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)
}

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
  • 2021-11-19
  • 2021-11-17
  • 2021-11-19
  • 2021-11-21
  • 2021-11-21
猜你喜欢
  • 2021-10-19
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
相关资源
相似解决方案