摘要: 算术运算符 下表列出了所有Go语言的算术运算符。假定 A 值为 10,B 值为 20 运算符描述实例 + 相加 A + B 输出结果 30 - 相减 A - B 输出结果 -10 * 相乘 A * B 输出结果 200 / 相除 B / A 输出结果 2 % 求余 B % A 输出结果 0 ++ 自 阅读全文
posted @ 2019-12-13 23:16 wenjianzhang 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 循环 Go语言仅支持循环关键字 for for i := 0; i<5; i++ 示例 while 条件循环 while(n<5) n := 0 for n < 5 { n++ fmt.Println(n) } while 无限循环 while(true) for { ... } package l 阅读全文
posted @ 2019-12-13 23:14 wenjianzhang 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 基本数据类型 bool string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr byte // alias for uint8 rune // alias for int32, represents a Un 阅读全文
posted @ 2019-12-13 23:12 wenjianzhang 阅读(310) 评论(0) 推荐(0) 编辑