龚成明 2 ani în urmă
părinte
comite
600f0ed392

+ 0 - 0
chapter01/helloworld.go → chapter01/01/helloworld.go


+ 0 - 0
chapter01/echo1.go → chapter01/02/echo1.go


+ 0 - 0
chapter01/echo2.go → chapter01/02/echo2.go


+ 0 - 0
chapter01/echo3.go → chapter01/02/echo3.go


+ 26 - 0
chapter01/03/dup1.go

@@ -0,0 +1,26 @@
+package main
+
+import (
+	"bufio"
+	"fmt"
+	"os"
+)
+
+func main() {
+	counts := make(map[string]int)
+	input := bufio.NewScanner(os.Stdin)
+	for input.Scan() {
+		text := input.Text()
+
+		counts[text]++
+
+		if text == "quit" {
+			break
+		}
+	}
+	for line, n := range counts {
+		if n >= 1 {
+			fmt.Printf("%d\t%s\n", n, line)
+		}
+	}
+}