golang rand 随机例子
转载声明:
本文为摘录自“csdn博客”,版权归原作者所有。
温馨提示:
为了更好的体验,请点击原文链接进行浏览
摘录时间:
2020-04-13 11:02:05
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)
}
}
---------------------
作者:Yatere
来源:CSDN
原文:https://blog.csdn.net/yatere/article/details/8765540
版权声明:本文为博主原创文章,转载请附上博文链接!