阶乘

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)
}

  

posted @ 2024-12-20 12:25  飞雪飘鸿  阅读(2)  评论(0编辑  收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL