package main
import "fmt"
func main(){
var a int
a = 100
var b int
b = 2
per := float32(b/a)
fmt.Printf("打印百分比: %.2f%%\n",per)
truePer := float32(b)/float32(a)
fmt.Printf("真正可以打印百分比的: %.2f%%",truePer)
}
2023-10-19 09:59:58
package main
import "fmt"
func main(){
var a int
a = 100
var b int
b = 2
per := float32(b/a)
fmt.Printf("打印百分比: %.2f%%\n",per)
truePer := float32(b)/float32(a)
fmt.Printf("真正可以打印百分比的: %.2f%%",truePer)
}