函数作用:
parseInt将字符串(String)类型转为整数类型。
Number() 函数把对象(Object)的值转换为数字。
语法不同:
parseInt(string, [radix])
string:必选参数,要被转换的字符串
radix:可选,数字的基数。取值范围在2~36。
如果该参数小于 2 或者大于 36,则 parseInt() 将返回 NaN。...
分类:
编程语言 时间:
2015-08-01 22:10:36
阅读次数:
149
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
思路:很基础的一个题,DFS即可。代码如下:
/**
* Defin...
分类:
其他好文 时间:
2015-08-01 22:08:25
阅读次数:
140
1、在安卓开发中,会遇到保存数据到手机中以及从手机中获取数据的情况/** * 把数据存放到手机内存中 * * @param number * @param password * @return */ public static boolean ...
分类:
移动开发 时间:
2015-08-01 21:58:33
阅读次数:
447
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line./** * Definition for a point. * class Point { * i...
分类:
其他好文 时间:
2015-08-01 20:26:30
阅读次数:
118
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 127653 Accepted Submission(s): 31033
Problem Description
A number sequence is defined...
分类:
其他好文 时间:
2015-08-01 19:06:53
阅读次数:
99
DescriptionGeorgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, …, and place N chessmen on different grids, as shown i...
分类:
其他好文 时间:
2015-08-01 17:21:22
阅读次数:
114
题目:戳我 题意:题意看懂了上面的一大串英文之后其实很简单,就是给你一个正整数n,问你n有多少个质因子,不过这里n是通过a!/b!给定的,也就是说n=(a!/b!); 分析:由于这里1?≤?b?≤?a?≤?5?000?000,数据很大,所以简单暴力一定超时,具体看代码。 1 #include...
分类:
其他好文 时间:
2015-08-01 17:16:27
阅读次数:
128
Dragon BallsProblem DescriptionFive hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for...
分类:
其他好文 时间:
2015-08-01 17:16:21
阅读次数:
90
You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a...
分类:
其他好文 时间:
2015-08-01 17:14:06
阅读次数:
134
Given a list of numbers, find the number of tuples of size N that add to S.for example in the list (10,5,-1,3,4,-6), the tuple of size 4 (-1,3,4,-6) a...
分类:
编程语言 时间:
2015-08-01 17:13:09
阅读次数:
229