func main() { const input = "Now is the winter of our discontent,\nMade glorious summer by this sun of York.\n" scanner := bufio.NewScanner(strings.NewReader(input))
scanner.Split(bufio.ScanWords) //分割
count := 0
for scanner.Scan() { count++ fmt.Println(scanner.Text()) }