摘要:
package main import "fmt" /* 保留小数点两位 a:= fmt.Sprintf("%.2f",33.3/6)//返回的是string类型 */ func main() { //定义数组 var hens[6]float64 //赋值 hens[0]=3.0 hens[1]= 阅读全文
posted @ 2021-05-12 22:12
不吃肉的羊
阅读(30)
评论(0)
推荐(0)
摘要:
package main import ( "errors" "fmt" "time" ) /* 错误处理机制 */ func test() { num1 := 10 num2 := 0 res := num1 / num2 fmt.Println(res) defer func() { //匿名函 阅读全文
posted @ 2021-05-12 19:48
不吃肉的羊
阅读(74)
评论(0)
推荐(0)

浙公网安备 33010602011771号