慕无忌1623718
找到了解决方案。bufio工作得更快(因为它被缓冲了,而fmt函数没有,并且它不解析任何内容):reader := bufio.NewReader(os.Stdin)str, _ := reader.ReadString('\n') // Like fmt.Scanf("%s", &str), but fastervar x, y runefmt.Fscanf(reader, "%c %c", &x, &y) // I need to read something else // (see comments for the question) // It's easy, as I can use fmt.Fscanf...甚至比那个Cscanf()包装器还快。