标签:print 变量 sar func import [] pre 更新 pack
代码演示:
package main import "fmt" import "sort" func main() { strs := []string{"c", "a", "b"} sort.Strings(strs) fmt.Println("Strings: ", strs) ints := []int{7, 2, 4} sort.Ints(ints) fmt.Println("Ints: ", ints) s := sort.IntsAreSorted(ints) fmt.Println("Sorted: ", s) }
代码运行结果:
Strings: [a b c] Ints: [2 4 7] Sorted: true
代码解读:
标签:print 变量 sar func import [] pre 更新 pack
原文地址:https://www.cnblogs.com/Joestar/p/8890360.html