You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
146 B
16 lines
146 B
3 years ago
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func su(n int) int {
|
||
|
if n == 0 {
|
||
|
return 1
|
||
|
} else {
|
||
|
return n * su(n-1)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
fmt.Println(su(7))
|
||
|
}
|