add: leetcode 0400 test

This commit is contained in:
tphyhFighting
2021-11-30 16:23:55 +08:00
parent a7a4e6dbed
commit adfdee1ef7

View File

@ -0,0 +1,45 @@
package leetcode
import (
"fmt"
"testing"
)
type question400 struct {
para400
ans400
}
// para 是参数
type para400 struct {
n int
}
// ans 是答案
type ans400 struct {
ans int
}
func Test_Problem400(t *testing.T) {
qs := []question400{
{
para400{3},
ans400{3},
},
{
para400{11},
ans400{0},
},
}
fmt.Printf("------------------------Leetcode Problem 400------------------------\n")
for _, q := range qs {
_, p := q.ans400, q.para400
fmt.Printf("【input】:%v 【output】:%v\n", p.n, findNthDigit(p.n))
}
fmt.Printf("\n\n\n")
}