From 410010a974c9dc64d9e1d6fe7c6cc0a2951d0820 Mon Sep 17 00:00:00 2001 From: "a.pivkin" Date: Sun, 11 Jan 2026 11:05:35 +0300 Subject: [PATCH] fg --- book_with_bridge/comon_shit/main.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/book_with_bridge/comon_shit/main.go b/book_with_bridge/comon_shit/main.go index 753e62b..3e8f556 100644 --- a/book_with_bridge/comon_shit/main.go +++ b/book_with_bridge/comon_shit/main.go @@ -2,19 +2,19 @@ package main import "fmt" -type Point struct { - x int -} - -func (p *Point) Inc() { - p.x++ +func Cakes(recipe, available map[string]int) int { + fin := 100000 + for k := range recipe { + fmt.Printf("recipe[k] is %d and available[k] is %d\n", recipe[k], available[k]) + temp := available[k] / recipe[k] + if temp < fin { + fin = temp + } + } + fmt.Println(fin) + return fin } func main() { - points := []Point{{1},{2},{3}} - - for i := range points { - points[i].Inc() - } - fmt.Println(points[0].x) -} \ No newline at end of file + Cakes(map[string]int{"flour": 500, "sugar": 200, "eggs": 1}, map[string]int{"flour": 1200, "sugar": 1200, "eggs": 5, "milk": 200}) +}