package main import ( "fmt" "time" "math/rand" ) func main() { r := rand.New(rand.NewSource(time.Now().UnixNano())) for i:=0; i<10; i++ { fmt.Println(r.Intn(100)) } } //该代码片段来自于: http://www.sharejs.com/codes/go/8974
有疑问加站长微信联系(非本文作者)
package main import ( "fmt" "time" "math/rand" ) func main() { r := rand.New(rand.NewSource(time.Now().UnixNano())) for i:=0; i<10; i++ { fmt.Println(r.Intn(100)) } } //该代码片段来自于: http://www.sharejs.com/codes/go/8974
有疑问加站长微信联系(非本文作者)
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
`单行代码`
package main import ( "fmt" "time" "math/rand" ) func main() { r := rand.New(rand.NewSource(time.Now().UnixNano())) for i:=0; i<10; i++ { fmt.Println(r.Intn(100)) } } //该代码片段来自于: http://www.sharejs.com/codes/go/8974