package main import "fmt" func fact(n int) int { if n == 0 { return 1 } return n * fact(n-1) } func main() { fmt.Println(fact(5)) }
package main import "fmt" func main() { a := []int{1, 2, 3, 4} tmp := 0 for i:=0; i < len(a)/2; i++ { tmp = a[i] a[i] = a[len(a)-(i+1)] a[len(a)-(i+1)] = tmp } fmt.Println(a) }
package main import "fmt" func main() { }
Copyrights © - Joinc, All Rights Reserved. Inherited From - Yundream Rebranded By - Joonphil
예제로 살펴보는 Go : Recursion
연습 문제
Recent Posts
Archive Posts
Tags