package main import "fmt" func main() { a, b := 15, 10 // 算术运算符 sum := a + b diff := a - b product := a * b quotient := a / b remainder := a % b // 比较运算符 eq := a == b gt := a > b lt := a < b fmt.Println("运算符示例:") fmt.Printf("%d + %d = %d\n", a, b, sum) fmt.Printf("%d - %d = %d\n", a, b, diff) fmt.Printf("%d * %d = %d\n", a, b, product) fmt.Printf("%d / %d = %d\n", a, b, quotient) fmt.Printf("%d %% %d = %d\n", a, b, remainder) fmt.Printf("%d == %d: %t\n", a, b, eq) fmt.Printf("%d > %d: %t\n", a, b, gt) fmt.Printf("%d < %d: %t\n", a, b, lt) }