5的阶乘以及随机输入字符串字符统计
package main
import “fmt”
func Factorial(n uint64) (result uint64) {
if (n > 0) {
result = n * Factorial(n-1)
return result
}
return 1
}
func main() {
var i int = 5
fmt.Printf("%d 的阶乘是 %d\n", i, Factorial(uint64(i)))
}
5的阶乘以及随机输入字符串字符统计
package main
import “fmt”
func Factorial(n uint64) (result uint64) {
if (n > 0) {
result = n * Factorial(n-1)
return result
}
return 1
}
func main() {
var i int = 5
fmt.Printf("%d 的阶乘是 %d\n", i, Factorial(uint64(i)))
}