码迷,mamicode.com
首页 >  
搜索关键字:digits    ( 2164个结果
LeetCode--Reverse Integer
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -32思路: 很简单的思路,对x对10取余数,把x从低位到高位的数字依次提取出来,再每次对结果乘10加上新取出的个位,最后x=x/1....
分类:其他好文   时间:2014-10-22 00:45:15    阅读次数:135
Euler Project question 16 in python way
# This Python file uses the following encoding: utf-8# 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.# What is the sum of the digits...
分类:编程语言   时间:2014-10-21 23:07:02    阅读次数:203
Reverse Integer 旋转数字
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321本地注意正负号判断比较关键,实现部分可能不是最优的,按照自己的想法实现:设ret = 1;每次对x进行取余mod,然后ret ...
分类:其他好文   时间:2014-10-21 22:49:34    阅读次数:223
【C#】Excel舍入函数Round、RoundUp、RoundDown的C#版
本人在C#中进行小数舍入的时候常常会怀念Excel中的Round、RoundUp、RoundDown这几个函数,原因就是后者“接地气”,比较符合俺小老百姓的舍入要求,啥“银行家舍入法”就让银行家去用吧。先温习一下这几个Excel函数的功能:Round(value, digits)将value按四舍五...
分类:Windows程序   时间:2014-10-20 19:19:21    阅读次数:253
LeetCode: Add Two Numbers 解题报告
Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co...
分类:其他好文   时间:2014-10-20 18:50:54    阅读次数:111
Euler Project question 48 in python way
# The series, 11 + 22 + 33 + ... + 1010 = 10405071317.# Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.import timestart = time....
分类:编程语言   时间:2014-10-19 21:24:41    阅读次数:243
Leetcode Plus One
//Given a non-negative number represented as an array of digits, plus one to the number.//The digits are stored such that the most significant digit i...
分类:其他好文   时间:2014-10-19 19:47:29    阅读次数:241
Reverse Integer | LeetCode
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ask...
分类:其他好文   时间:2014-10-16 21:06:03    阅读次数:180
[Leetcode] Reverse Integer
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...
分类:其他好文   时间:2014-10-16 09:13:42    阅读次数:150
leetcode - Plus One
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. class Solution { pub...
分类:其他好文   时间:2014-10-14 16:04:43    阅读次数:154
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!