题目描述
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Example 2:
Example 3:
Note:
Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows.
GoLang 语法:if 判断
- if 判断的一般形式
(1)关键字 if 和 else 之后的左大括号 { 必须和关键字在同一行
(2)如果你使用了 else-if 结构,则前段代码块的右大括号 } 必须和 else-if 关键字在同一行
- 带有初始语句的 if 判断
(1)在初始化语句后方必须加上分号
AC 代码