-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaps.go
39 lines (38 loc) · 905 Bytes
/
maps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
//func main() {
// prices := make(map[string]int)
// prices["хлеб"] = 50
// prices["молоко"] = 100
// prices["масло"] = 200
// prices["колбаса"] = 500
// prices["соль"] = 20
// prices["огурцы"] = 200
// prices["cыр"] = 600
// prices["ветчина"] = 700
// prices["буженина"] = 900
// prices["помидоры"] = 250
// prices["рыба"] = 300
// prices["хамон"] = 1500
//
// fmt.Println("Деликатесы: ")
// for k, v := range prices {
// if v > 500 {
// fmt.Println(k)
// }
// }
//
// order := []string{"хлеб", "буженина", "сыр", "огурцы"}
// total := 0
// //for i := range order {
// // for k, v := range prices {
// // if order[i] == k {
// // total += v
// // }
// // }
// //}
//
// for _, v := range order {
// total += prices[v]
// }
// fmt.Print("Стоимость заказа: ", total)
//}