mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-08-02 02:17:53 +08:00
规范格式
This commit is contained in:
@ -0,0 +1,47 @@
|
||||
package leetcode
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type question557 struct {
|
||||
para557
|
||||
ans557
|
||||
}
|
||||
|
||||
// para 是参数
|
||||
// one 代表第一个参数
|
||||
type para557 struct {
|
||||
s string
|
||||
}
|
||||
|
||||
// ans 是答案
|
||||
// one 代表第一个答案
|
||||
type ans557 struct {
|
||||
one string
|
||||
}
|
||||
|
||||
func Test_Problem557(t *testing.T) {
|
||||
|
||||
qs := []question557{
|
||||
|
||||
question557{
|
||||
para557{"Let's take LeetCode contest"},
|
||||
ans557{"s'teL ekat edoCteeL tsetnoc"},
|
||||
},
|
||||
|
||||
question557{
|
||||
para557{""},
|
||||
ans557{""},
|
||||
},
|
||||
}
|
||||
|
||||
fmt.Printf("------------------------Leetcode Problem 557------------------------\n")
|
||||
|
||||
for _, q := range qs {
|
||||
_, p := q.ans557, q.para557
|
||||
fmt.Printf("【input】:%v 【output】:%v\n", p, reverseWords(p.s))
|
||||
}
|
||||
fmt.Printf("\n\n\n")
|
||||
}
|
Reference in New Issue
Block a user