Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "bufio"
- "os"
- // "strings"
- "fmt"
- )
- func main() {
- m := make(map[string]int, 1)
- for i := 0; i < 4; i++ {
- reader := bufio.NewReader(os.Stdin)
- text, _ := reader.ReadString('\r')
- // fmt.Println(text)
- // text = strings.TrimSuffix(text, "\n")
- text_c := []rune(text)
- if len(text_c) == 0 {
- continue
- } else if text_c[0] == '\r' || text_c[0] == '\n' {
- continue
- }
- // fmt.Println(text_c)
- tmp_j := 0
- for j, n := range text_c {
- if n == ' ' || n == '\r' || n == '\n' {
- tmp := text_c[tmp_j:j]
- // fmt.Println(string(tmp))
- if string(tmp) == "" {
- continue
- }
- m[string(tmp)] ++
- // text_c = text_c[j+1:]
- tmp_j = j + 1
- }
- }
- }
- fmt.Println(len(m))
- // fmt.Println(m)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement