Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

19/01/24

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
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.