mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-06 01:15:57 +08:00
46 lines
611 B
Go
46 lines
611 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type question520 struct {
|
|
para520
|
|
ans520
|
|
}
|
|
|
|
// para 是参数
|
|
type para520 struct {
|
|
word string
|
|
}
|
|
|
|
// ans 是答案
|
|
type ans520 struct {
|
|
ans bool
|
|
}
|
|
|
|
func Test_Problem520(t *testing.T) {
|
|
|
|
qs := []question520{
|
|
|
|
{
|
|
para520{"USA"},
|
|
ans520{true},
|
|
},
|
|
|
|
{
|
|
para520{"FlaG"},
|
|
ans520{false},
|
|
},
|
|
}
|
|
|
|
fmt.Printf("------------------------Leetcode Problem 520------------------------\n")
|
|
|
|
for _, q := range qs {
|
|
_, p := q.ans520, q.para520
|
|
fmt.Printf("【input】:%v 【output】:%v\n", p, detectCapitalUse(p.word))
|
|
}
|
|
fmt.Printf("\n\n\n")
|
|
}
|