官方文档中的16页:numbers.map({ (number: Int) -> Int in let result = 3 * number return result })不知道这个怎么用,更不知道它所说的要写个把奇数改成0的方法。
分类:
其他好文 时间:
2014-06-26 19:06:05
阅读次数:
193
UVA 10539 - Almost Prime Numbers题目链接题意:给定一个区间,求这个区间中的Almost prime number,Almost prime number的定义为:仅仅能整除一个素数。思路:既然是仅仅能整除一个素数,那么这些数肯定为素数的x次方(x > 1),那么仅仅要...
分类:
其他好文 时间:
2014-06-26 18:11:51
阅读次数:
169
-- author : coder_zhang-- date : 2014-6-25root = nilfunction insert_node(number) if root == nil then root = {value = number, left = nil, ...
分类:
其他好文 时间:
2014-06-26 16:51:36
阅读次数:
170
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2014-06-26 15:50:35
阅读次数:
176
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each number ...
分类:
其他好文 时间:
2014-06-26 15:45:49
阅读次数:
163
1.变量转换
看起来很简单,但据我所看到的,使用构造函数,像Array()或者Number()来进行变量转换是常用的做法。始终使用原始数据类型(有时也称为字面量)来转换变量,这种没有任何额外的影响的做法反而效率更高。
1
2
3
4
5
6
7
var myVar
= "3.14159",
st...
分类:
编程语言 时间:
2014-06-26 13:53:45
阅读次数:
262
写这篇原创文章是因为看到了极客中的一篇文章《有趣各种编程语言实现2+2=5》,其中C语言是这样实现的:
int main() {
char __func_version__[] = “5″; // For source control
char b[]=”2″, a=2;
printf(“%d + %s = %s\n”, a, b, a+b);
return 0;
}
有些童鞋可能会说...
分类:
编程语言 时间:
2014-06-26 11:03:19
阅读次数:
282
【题目】
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
【题意】
给定一个整数数组,其中除了一个数以外,其他数都是成对出现的,...
分类:
其他好文 时间:
2014-06-26 10:13:27
阅读次数:
254
Transact-SQL提供了4个排名函数: RANK(),DENSE_RANK(),ROW_NUMBER(),NTILE(),下文是对这4个函数进行的解释。...
分类:
数据库 时间:
2014-06-26 08:01:11
阅读次数:
304
依赖
<dependency>
<groupId>org.archive.heritrix</groupId>
<artifactId>heritrix-commons</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
..
分类:
其他好文 时间:
2014-06-26 06:19:10
阅读次数:
300