You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2015-01-30 15:55:05
阅读次数:
196
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a l...
分类:
其他好文 时间:
2015-01-30 10:55:06
阅读次数:
293
原题地址将单词按空格分词,然后倒序拼接即可代码: 1 void reverseWords(string &s) { 2 vector words; 3 4 int start = -1; 5 int len = 0; 6 ...
分类:
其他好文 时间:
2015-01-30 10:30:11
阅读次数:
157
Areversibleprimeinanynumbersystemisaprimewhose"reverse"inthatnumbersystemisalsoaprime.Forexampleinthedecimalsystem73isareversibleprimebecauseitsrevers...
分类:
其他好文 时间:
2015-01-30 07:52:34
阅读次数:
145
原题地址基本栈操作。注意数字有可能是负的。代码: 1 int toInteger(string &s) { 2 int res = 0; 3 bool negative = s[0] == '-' ? true : false; 4 5 for (int i = neg...
分类:
其他好文 时间:
2015-01-29 20:56:23
阅读次数:
164
B - Reverse Root
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
The problem is so easy, that the authors were lazy to write a ...
分类:
其他好文 时间:
2015-01-29 14:38:16
阅读次数:
99
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321解法一:public class Solution { public int reverse(int x) { ...
分类:
其他好文 时间:
2015-01-29 00:00:26
阅读次数:
313
题目链接:Reverse Integer
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Have you thought about this?
Here are some good questions to ask before coding. Bo...
分类:
其他好文 时间:
2015-01-28 14:47:05
阅读次数:
156
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Have you thought about this?
Here are some good questions to ask before coding. Bonus points for y...
分类:
其他好文 时间:
2015-01-28 10:00:47
阅读次数:
161
思路倒是简洁明了,将整数的非符号部分的各位存储到一个数组里面,然后将各位组装起来就成为一个新的整数。当然,溢出,符号都是需要考虑的。...
分类:
其他好文 时间:
2015-01-28 09:43:02
阅读次数:
93