1. 交换两个数值
x, y = y, x; //等价于 x = y, y =x;
2. 变量初始化问题
a, b, c = 0;
print(a,b,c); --> 0 nil nil
仅对第一个值复制,所以要初始化一组变量,应该提供多个初始值
a, b, c = 0, 0, 0;
print(a, b, c); --> 0 0 0
3. "尽可能...
分类:
其他好文 时间:
2014-05-10 10:17:39
阅读次数:
272
重载操作符与转换--输入/输出、算术/关系操作符 支持I/O操作的类所提供的I/O操作接口,一般应该与标准库iostream为内置类型定义的接口相同,因此,许多类都需要重载输入和输出操作符。一、输出操作符的重载 为了与IO标准库一致,操作符应接受ostream&作为第一个形参,对类类型const对象的引用作为第二个形参,并返回ostream形参的引用!ostream &operator<<...
分类:
编程语言 时间:
2014-05-07 08:52:44
阅读次数:
380
John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachable along a single, one-way road. John starts at lake 1, but he can finish at any lake he wants. He can only travel from on...
分类:
其他好文 时间:
2014-05-07 08:48:52
阅读次数:
515
import org.junit.Test;
public class AllSort {
public void permutation(char[] buf, int start, int end) {
if (start == end) {// 当只要求对数组中一个字母进行全排列时,只要就按该数组输出即可
for (int i = 0; i <= end; i++) {
...
分类:
编程语言 时间:
2014-05-07 08:26:47
阅读次数:
364
这里是windows下 使用1.4.3版本时候出现的问题。
问题1
I:\git\orangle.github.io>jekyll serve --watch
Configuration file: I:/git/orangle.github.io/_config.yml
Source: I:/git/orangle.github.io
Destinat...
分类:
其他好文 时间:
2014-05-07 08:04:31
阅读次数:
486
??
Lost Cows
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8838
Accepted: 5657
Description
N (2 <= N <= 8,000) cows have unique brands in the range 1..N. ...
分类:
其他好文 时间:
2014-05-07 07:58:26
阅读次数:
337
import org.junit.Test;
public class Multiple {
public void printMultiple99() {
int i = 1;
for (; i < 10; i++)
for (int j = 1; j <= i; j++)
System.out.print(j + "*" + i + "=" + i * j + " ...
分类:
其他好文 时间:
2014-05-07 06:46:25
阅读次数:
359
paip.取当天记录的方法sql跟hql hibernate
#------两个方法...函数法和日期计算法..
函数法: DATEDIFF(d,createTime,GETDATE())=0 //d指定为day
hb也有一样的函数..
日期 计算法: where createTime>='2014-5-4 00:00:01' and createTime
where cre...
分类:
数据库 时间:
2014-05-07 06:39:29
阅读次数:
436
1、实现源码
JavaScript实现获取table中某一列的值
function getTdValue()
{
var tableId = document.getElementById("tab");
var str = "";
for(var i=1;i<tableId.rows.length;i++)
{
alert(tableId.row...
分类:
编程语言 时间:
2014-05-07 06:27:47
阅读次数:
478