Open lyc10031 opened 5 years ago
https://lyc10031.github.io/2019/09/17/go-scripts.html
翻转一个整数 输入123,返回321;输入-321返回-123 输入的整数要求是一个 32bit 有符号数,如果反转后溢出,则输出 01234567891011func reverse(x int) (num int) { for x != 0 { num = num*10 + x%10 x = x / ...
https://lyc10031.github.io/2019/09/17/go-scripts.html
翻转一个整数 输入123,返回321;输入-321返回-123 输入的整数要求是一个 32bit 有符号数,如果反转后溢出,则输出 01234567891011func reverse(x int) (num int) { for x != 0 { num = num*10 + x%10 x = x / ...