2020-06-30 11:47:38 +08:00
|
|
|
|
/*
|
|
|
|
|
|
* @Author : huangzj
|
|
|
|
|
|
* @Time : 2020/6/29 17:15
|
|
|
|
|
|
* @Description:
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
package rand
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"fmt"
|
|
|
|
|
|
"strconv"
|
|
|
|
|
|
"testing"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func TestRand(t *testing.T) {
|
2020-08-18 17:29:42 +08:00
|
|
|
|
fmt.Printf(strconv.Itoa(GetRandInt(100, 2000)))
|
|
|
|
|
|
for _, r := range GetRandIntNoRepeat(10, 100, 200) {
|
2020-06-30 11:47:38 +08:00
|
|
|
|
fmt.Printf(strconv.Itoa(r))
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-08-18 17:29:42 +08:00
|
|
|
|
for _, r := range GetDiffNum([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 10) {
|
2020-06-30 11:47:38 +08:00
|
|
|
|
fmt.Printf(strconv.Itoa(r))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|