We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c277b65 commit 087aae3Copy full SHA for 087aae3
08/map2.go
@@ -10,26 +10,21 @@ func main() {
10
var key string
11
var value uint64
12
fmt.Scan(&bookSize)
13
-
14
contactBook := make(map[string]uint64)
15
16
for i := 0; i < bookSize; i++ {
17
18
fmt.Scan(&key)
19
fmt.Scan(&value)
20
contactBook[key] = value
21
}
22
23
24
scanner := bufio.NewScanner(os.Stdin)
+
25
for scanner.Scan() {
26
27
- query := scanner.Text()
28
29
- if _, found := contactBook[query]; found {
30
- fmt.Print(query,"=",contactBook[query], "\n")
31
- } else {
32
- fmt.Println("Not found")
+ query := scanner.Text()
+ if _, found := contactBook[query]; found {
+ fmt.Print(query,"=",contactBook[query], "\n")
+ } else {
+ fmt.Println("Not found")
33
34
35
0 commit comments