package main
import (
"math/rand"
"fmt"
"time"
)
func main() {
for i := 0; i < 10; i++ {
a := rand.Int()
fmt.Printf("%d/", a)
}
fmt.Println()
for i:=0;i<5;i++ {
r:=rand.Intn(8)
fmt.Printf("%d/",r)
}
fmt.Println()
timens := int64(time.Now().Nanosecond())
rand.Seed(timens)
for i := 0; i < 10; i++ {
fmt.Printf("%2.2f / ", 100*rand.Float32())
}
}
有疑问加站长微信联系(非本文作者)