标签:print 32位 return 语言 package import pack int str
package main import ( "fmt" "strconv" ) func fanzhuang32(number int) string { fuhao := "" if number < 0 { number = 0 - number fuhao = "-" } str1 := strconv.Itoa(number) j := len(str1) str := "" for i := j; i > 0; i-- { str += str1[i-1 : i] } return fuhao + str } func main() { re := fanzhuang32(-123456) fmt.Println(re) }
标签:print 32位 return 语言 package import pack int str
原文地址:https://www.cnblogs.com/z-jx/p/9062824.html