标签:
package main import ( "fmt" "math/rand" "time" ) func main() { rand.Seed(time.Now().UnixNano()) for i := 0; i < 10; i++ { x := rand.Intn(100) fmt.Println(x) } }
Golang 生成随机数
原文地址:http://www.cnblogs.com/libertycode/p/5914697.html