Skip to content

Commit 7600ac6

Browse files
committed
Formatted the code
1 parent 08e3b45 commit 7600ac6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

C++/chapImplement.tex

+12-12
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ \subsubsection{代码}
3838
public:
3939
int reverse (int x) {
4040
long long r = 0;
41-
long long t = x;
42-
t = t > 0 ? t : -t;
41+
long long t = x;
42+
t = t > 0 ? t : -t;
4343
for (; t; t /= 10)
4444
r = r * 10 + t % 10;
4545

46-
bool sign = x > 0 ? false: true;
47-
if (r > 2147483647 || (sign && r > 2147483648)) {
48-
return 0;
49-
} else {
50-
if (sign) {
51-
return -r;
52-
} else {
53-
return r;
54-
}
55-
}
46+
bool sign = x > 0 ? false: true;
47+
if (r > 2147483647 || (sign && r > 2147483648)) {
48+
return 0;
49+
} else {
50+
if (sign) {
51+
return -r;
52+
} else {
53+
return r;
54+
}
55+
}
5656
}
5757
};
5858
\end{Code}

0 commit comments

Comments
 (0)