题解 | #进制转换#
进制转换
https://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { //2 for "0b", 8 for "0" or "0o",16 for "0x", and 10 otherwise. input := bufio.NewScanner(os.Stdin) input.Scan() inputStr := input.Text() parseUint, _ := strconv.ParseUint(inputStr[2:], 16, 32) fmt.Println(parseUint) }