码迷,mamicode.com
首页 >  
搜索关键字:digits    ( 2164个结果
LeetCode[Array]: 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. 一开始我误解了题目的意思,以为是新建一个...
分类:其他好文   时间:2014-10-31 22:16:05    阅读次数:253
Problem 005——Digit Generator
1583 - Digit GeneratorFor a positive integer N , the digit-sum of N is defined as the sum of N itself and its digits. When M is the digitsum of N , we...
分类:其他好文   时间:2014-10-30 22:18:18    阅读次数:234
Euler Project question 30 in python way
# Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:# 1634 = 14 + 64 + 34 + 44# 8208 = 84 + 24...
分类:编程语言   时间:2014-10-30 18:40:45    阅读次数:183
Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 简单模拟 class Solution { public: int reverse(int x) { char s[1111]; sprintf(s,"%d",...
分类:其他好文   时间:2014-10-29 22:19:54    阅读次数:211
JDK中Integer类的进制转换实现
JDK中关于Integer类的进制转换方法很精巧,具体实现如下:final static char[] digits = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , ...
分类:其他好文   时间:2014-10-29 21:20:14    阅读次数:150
poj 1147 Binary codes
Binary codes Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5647   Accepted: 2201 Description Consider a binary string (b1…bN) with N binary digits. Given s...
分类:其他好文   时间:2014-10-29 14:59:04    阅读次数:127
[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. 代码: ...
分类:其他好文   时间:2014-10-28 17:49:25    阅读次数:147
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. 题目描述: 输入一个数组表示的...
分类:其他好文   时间:2014-10-28 13:53:27    阅读次数:157
[LeetCode]Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 考虑输入是abc,返回结果是cba,那么如果用除法(除以10)取余数操作的话,是先入先出的操作(第一次入abc%10=c),因此选择使用队列。 复习队列的方法有q.size(),q.front()...
分类:其他好文   时间:2014-10-27 23:05:42    阅读次数:200
[LeetCode] 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 ...
分类:其他好文   时间:2014-10-27 22:58:01    阅读次数:269
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!