From dd97a844fe61aac7971836e9a49e80e97b794b66 Mon Sep 17 00:00:00 2001 From: tphyhFighting <2363176358@qq.com> Date: Mon, 7 Mar 2022 10:40:24 +0800 Subject: [PATCH] add: leetcode 0504 test --- leetcode/0504.Base-7/504.Base 7_test.go | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 leetcode/0504.Base-7/504.Base 7_test.go diff --git a/leetcode/0504.Base-7/504.Base 7_test.go b/leetcode/0504.Base-7/504.Base 7_test.go new file mode 100644 index 00000000..1309c1b6 --- /dev/null +++ b/leetcode/0504.Base-7/504.Base 7_test.go @@ -0,0 +1,46 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question504 struct { + para504 + ans504 +} + +// para 是参数 +type para504 struct { + num int +} + +// ans 是答案 +type ans504 struct { + ans string +} + +func Test_Problem504(t *testing.T) { + + qs := []question504{ + + { + para504{100}, + ans504{"202"}, + }, + + { + para504{-7}, + ans504{"-10"}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 504------------------------\n") + + for _, q := range qs { + _, p := q.ans504, q.para504 + fmt.Printf("【input】:%v ", p.num) + fmt.Printf("【output】:%v \n", convertToBase7(p.num)) + } + fmt.Printf("\n\n\n") +}