mirror of
https://github.com/ShusenTang/LeetCode.git
synced 2024-09-02 14:20:01 +00:00
Update 7. Reverse Integer.md
This commit is contained in:
parent
896669da4a
commit
abcc0a6bce
@ -7,7 +7,7 @@
|
|||||||
* Python 3.6:>>> (-7) % 3 // 输出 2
|
* Python 3.6:>>> (-7) % 3 // 输出 2
|
||||||
# C++
|
# C++
|
||||||
## 方法一
|
## 方法一
|
||||||
```
|
``` C++
|
||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
int reverse(int x) {
|
int reverse(int x) {
|
||||||
@ -25,8 +25,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
## 方法二(较方法一更快)
|
## 方法二(较方法一更快)
|
||||||
```
|
``` C++
|
||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
int reverse(int x) {
|
int reverse(int x) {
|
||||||
|
Loading…
Reference in New Issue
Block a user