题解 | #进制转换#
进制转换
http://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
package main
import (
"fmt"
)
func main() {
for {
var ret int
_, err := fmt.Scanf("0x%X", &ret)
if err != nil {
break
}
fmt.Println(ret)
}
}
进制转换
http://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
package main
import (
"fmt"
)
func main() {
for {
var ret int
_, err := fmt.Scanf("0x%X", &ret)
if err != nil {
break
}
fmt.Println(ret)
}
}
相关推荐