package main import ( "bufio" "fmt" "os" "strings" ) func main() { /* 解题思路:将获取的字符串一空格分隔为数组,求出数组最后一项的长度 */ bs, _, _ := bufio.NewReader(os.Stdin).ReadLine() arr := strings.Fields(string(bs)) fmt.Println(len(arr[len(arr)-1])) }