recursion_Golang (#33)

* recursion_Golang

* go_fmt
This commit is contained in:
seong954t
2017-10-16 05:31:56 +09:00
committed by Aditya Bhargava
parent 88cf645af9
commit 38d50415e8
3 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package main
import "fmt"
func fact(x int) int {
if x == 1 {
return 1
} else {
return x * fact(x-1)
}
}
func main() {
fmt.Println(fact(5))
}