Go Slices Int Slice Reverse

Description

Go Slices Int Slice Reverse

package main/*from  ww  w . j  a  va2  s .  c  o m*/

import (
  "fmt"
  "sort"
)
func main() {

  fmt.Println("Interger Reverse Sort")
  num := []int{3,2,6,1,9,3}
  sort.Sort(sort.Reverse(sort.IntSlice(num)))
  fmt.Println(num)

  
}



PreviousNext

Related