题目链接: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
题目链接:Add Two Numbers
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 a...
分类:
其他好文 时间:
2015-01-27 23:36:05
阅读次数:
373
注意: int N; cin >> N; cin.ignore(); 同于 int N;scanf("%d\n",&N);另:关于 cin 与 scanf:scanf是格式化输入,printf是格式化输出。cin是输入流,cout是输出流。效率稍低,但书写简便。格式化输出效率比较高,但是写代码...
分类:
其他好文 时间:
2015-01-27 21:44:24
阅读次数:
176
描述:
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 ...
分类:
其他好文 时间:
2015-01-27 20:23:35
阅读次数:
154
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-27 09:29:46
阅读次数:
186
Text Reverse
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 18240 Accepted Submission(s): 6900
Problem Description
Ignatius...
分类:
其他好文 时间:
2015-01-26 22:58:27
阅读次数:
256
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som...
分类:
其他好文 时间:
2015-01-26 20:55:35
阅读次数:
171
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
大意
反转int的数字。
难度系数: 容易
实现
易错点是没有做溢出检查。后来我看了下网上的答案,写的比我好很多(好惭愧)。所以这题就给出个网上的答案吧。
int reverse(i...
分类:
其他好文 时间:
2015-01-26 11:57:48
阅读次数:
141