常对象:定义常对象的一般形式为: 类名 const 对象名[(实参表列)];也可以把const写在最左面: const 类名 对象名[(实参表列)];二者等价。常对象的所有成员值都不能变,必须先初始化,不能调用非const成员函数const成员函数: void get_time( ...
分类:
编程语言 时间:
2014-06-29 06:16:24
阅读次数:
161
获取你要抓取的页面 const string URL = "http://www.hn3ddf.gov.cn/price/GetList.html?pageno=1"; string htmlStr = null; for (int i = 0; i (.*?)", RegexOptions.Si....
分类:
Web程序 时间:
2014-06-29 00:49:28
阅读次数:
369
1 . lef命令ES6新增了let命令,用来声明变量。它的用法类似于var,let声明的变量,只在let命令所在的代码块内有效。{ let a = 10; var b = 1;}a // ReferenceError: a is not defined.b //12.const命令co...
分类:
其他好文 时间:
2014-06-28 21:49:58
阅读次数:
185
题目
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only const...
分类:
其他好文 时间:
2014-06-18 11:53:39
阅读次数:
138
水题,一个小模拟,规律也好找
f3 = f1 * 2 + f2;
#include
#include
#include
#include
#include
const int INF = 1e8;
const int N = 100;
#define ll long long
using namespace std;
int a[251][N];
int b[N] = {0};
in...
分类:
其他好文 时间:
2014-06-18 07:28:29
阅读次数:
190
分治法的典例
当练手了
神奇的是,使用inplace_merge按说应该是O(n)的算法,但是用sort nlogn的算法反而更快
先上快排版
#include
#include
#include
#include
#include
using namespace std;
const int SIZE = 10000+10;
const double INF = 1...
分类:
其他好文 时间:
2014-06-18 07:17:22
阅读次数:
170
1.字节码指令
LOAD_CONST:从consts表中读取序号为i的元素并压入到运行时栈中
STORE_NAME:改变local名字空间。从符号表names取序号为i的元素作为变量名,
取运行时栈的栈顶元素作为变量值,完成从变量名到变量值的映射关系的创建。
BUILD_MAP:创建一个空的PyDictObject对象,并压入运行时栈
DUP_TOP:将栈顶元素的引用计数增加1,并将它再次压入栈中
ROT_TWO:将栈顶的两个元素进行对调
LOAD_NAME:符号搜索,并将该元素压入运行时栈
Py...
分类:
编程语言 时间:
2014-06-18 00:32:18
阅读次数:
295
题目思想比較简单,可是题目要求输出路径比較麻烦,学习了Ice_Crazy博主的方法,感觉不错。#include #include"stdio.h"#include"string.h"#include"queue"using namespace std;const int maxn = 100 + 5...
分类:
其他好文 时间:
2014-06-18 00:23:10
阅读次数:
233
(4)DoDrawLayout DoDrawLayout函数的源代码分析如下: procedure TTextLayoutNG.DoDrawLayout(const ACanvas: TCanvas);var CharDic: TCharDic; Rec: PCharRec; Pos: TPoint...
分类:
其他好文 时间:
2014-06-18 00:01:49
阅读次数:
284
(4)UpdateCharRec 该函数的源码分析如下: procedure TTextLayoutNG.UpdateCharRec(const ACanvas: TCanvas; NeedBitmap: Boolean; var NewRec: PCharRec; HasItem: Boolean...
分类:
其他好文 时间:
2014-06-17 23:40:36
阅读次数:
373