题解 | #输出单向链表中倒数第k个结点#
字符串最后一个单词的长度
http://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
package main
import ( "fmt" "os" "bufio" "strings" // "strconv" )
func main() { input := bufio.NewScanner(os.Stdin) input.Scan() word := strings.Split(input.Text(), " ")[len(strings.Split(input.Text(), " "))-1] fmt.Println(len(word)) }