如何取出亂數的每一位數並放在切片中

Sketh · · 536 次点击
```go package main import "fmt" func main() { a := 123456789 b := make([]int, 0) for a > 0 { b = append([]int{a % 10}, b...) a = a / 10 } fmt.Printf("b:%+v\n", b) } ```
#1