This commit is contained in:
a.pivkin 2026-01-11 11:05:35 +03:00
parent 2e763f0dd6
commit 410010a974

View File

@ -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)
Cakes(map[string]int{"flour": 500, "sugar": 200, "eggs": 1}, map[string]int{"flour": 1200, "sugar": 1200, "eggs": 5, "milk": 200})
}