lyc10031 / gitalk

my gitalk
0 stars 0 forks source link

Go 脚本记录说明 - Ray_YC's Blog #18

Open lyc10031 opened 5 years ago

lyc10031 commented 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 / ...