package main import "fmt" func main() { fmt.Printf("hello, world2\n") fmt.Printf("return is %d", f(3, 2) ) } func f(x int, y int) int { z := 0 if x > 0 { fmt.Printf("x%d >= 0 なのでf(x%d-1, y)呼び出し\n", x, x) z = f(x-1, y) } fmt.Printf("x = %d\n", x) fmt.Printf("%d+%d+%d = %d\n", x, y, z, x+y+z) return x+y+z }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more