feat(Go-Tool):2021/06/16 新增一个数拆分成N个数且N个数相加和等于这个数工具、测试方法
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* @Author : huangZJ
|
||||
* @Time : 2021/6/16 10:52
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
package splitNumToN
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSplitNumTo3(t *testing.T) {
|
||||
for i := 4; i <= 17; i++ {
|
||||
fmt.Println()
|
||||
fmt.Println(fmt.Sprintf("当前随机数为%d", i))
|
||||
for j := 0; j < 100; j++ {
|
||||
fmt.Println()
|
||||
SplitNumTo3(i)
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user