package main import ( "fmt" "strconv" "github.com/01-edu/z01" "strings" student "../../student" ) func ItoaBase(value, base int) string { if base < 2 || base > 16 { return "" } return strings.ToUpper(strconv.FormatInt(int64(value), base)) } func main() { value := z01.RandIntBetween(-1000000, 1000000) base := z01.RandIntBetween(2, 16) fmt.Println(student.ItoaBase(141895, 11)) fmt.Println(ItoaBase(value, base)) }