摘要: package main import ( "fmt" "strconv" ) type funcType func(int, int) int // 自定义函数类型 type Callback func(int, int) int type Callback2 func(string) func 阅读全文
posted @ 2021-09-28 17:40 专职 阅读(141) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "strings" ) // 使用type关键字让函数变成一个自定义类型 type caseFunc func(string) string type funcOddEven func(int) bool func main() { /* 将函 阅读全文
posted @ 2021-09-28 15:12 专职 阅读(993) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" func main() { //printFormula() // 打印九九乘法表 //printLeftTriangle() // 左下角打印直角三角形 //printRightTriangle() // 右下角打印直角三角形 forRangeS 阅读全文
posted @ 2021-09-28 13:37 专职 阅读(285) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" func main() { days := CalcDaysFromYearMonth(2021, 9) fmt.Println(days) } func CalcDaysFromYearMonth(year, month int) (days i 阅读全文
posted @ 2021-09-28 10:53 专职 阅读(266) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" var a = 21.0 var b = 5.0 //var c float64 func main() { Arithmetic() // 算数运算 BitOperation() // 位运算 LogicalOperation() // 逻辑运算 阅读全文
posted @ 2021-09-28 10:23 专职 阅读(110) 评论(0) 推荐(0) 编辑