math
文章平均质量分 58
mnhdd
这个作者很懒,什么都没留下…
展开
-
LeetCode OJ: 9. Palindrome Number (C++)
题目:Determine whether an integer is a palindrome. Do this without extra space.解法1、需要额外空间: 存储各位数字,逆转,换回逆转值,与原值比较class Solution {public: int reverse(int x) { long long sum=0; lo原创 2016-06-03 17:07:09 · 472 阅读 · 1 评论 -
LeetCode 172. Factorial Trailing Zeroes(C++)
题目:Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity.解法1:: 分析:对n!做质因数分解n!=2x*3y*5z*...显然0的个数等于min(原创 2016-06-03 18:57:28 · 333 阅读 · 1 评论