Printf和c语言的格式很像,整数直接就是%d了。
package main import ( "fmt" ) func main() { fmt.Printf("%d\n",97/7) fmt.Printf("%d\n",97%7) }