阶乘
package main import "fmt" func main() { //阶乘 jiecheng := 1 for i := 1; i < 10; i++ { jiecheng *= i fmt.Printf("%d的阶乘是%d\n", i, jiecheng) } }
package main import "fmt" func shengfa(a int, b int) (int, int) { return a * b, a / b } func main() { q, r := shengfa(10, 3) fmt.Println("乘法", q, "除法", r) }