2014年9月18日

摘要: 一个C程序在内存空间里面主要包括以下几个部分:1,代码段2,数据段3,栈4,堆 代码访问代码段,数据段放静态和全局变量,函数参数和局部变量放在堆栈里面,堆里面存是malloc分配的区域 堆栈里面是一个栈的结构,往里push东西的时候就小的数据就是向整形,浮点型这类基本的数据。但是stack有一个更大... 阅读全文
posted @ 2014-09-18 15:12 Champion Lai 阅读(200) 评论(0) 推荐(0) 编辑

2014年9月17日

摘要: #include#include#includeusing namespace std;int main(){ string str,p; cin>>str>>p; int n=str.length(); int m=p.length(); //compute ... 阅读全文
posted @ 2014-09-17 22:23 Champion Lai 阅读(149) 评论(0) 推荐(0) 编辑

2014年9月5日

摘要: #include#includeusing namespace std;#define MAX 99999int father[MAX];struct Edge{ int a; int b; int dist; bool operatore.dist) return true... 阅读全文
posted @ 2014-09-05 15:32 Champion Lai 阅读(152) 评论(0) 推荐(0) 编辑

2014年8月31日

摘要: 这题目最坑了,我做的A题最坑的一道1,首先输入数据不一定是四位的,泪奔,输入1,222,222,试一试2,在运行过程中需要判定结果是否为0,需要跳出#include#include#includeusing namespace std;void get(char * data,int & max,i... 阅读全文
posted @ 2014-08-31 18:57 Champion Lai 阅读(167) 评论(0) 推荐(0) 编辑

2014年8月30日

摘要: #include#include#include#define MAX 1000int main(){ char str[MAX]; char exp[MAX]; char data_sym; char comp_sym; while(scanf("%s",str)!=... 阅读全文
posted @ 2014-08-30 20:16 Champion Lai 阅读(182) 评论(0) 推荐(0) 编辑

2014年8月26日

摘要: Vector:写vector时候碰到这样一段代码: for(int j=0;j#include#includeusing namespace std;int _tmain(int argc, _TCHAR* argv[]){ /*set myset; myset.insert(10... 阅读全文
posted @ 2014-08-26 22:14 Champion Lai 阅读(134) 评论(0) 推荐(0) 编辑

2014年8月15日

摘要: 程序员的自我修养,最开始看这本书是在学校的图书馆,当时翻了几下,发现这本书内容还真挺特别的。是浙大几个老师写的,就更感觉亲切了,所以自己买了一本书来看看,这也是我到研究生之后买的第一本书了,哈哈,平时都是pdf啥的,其实pdf真不好看。 言归真正,讲讲昨天看到的 从一个HelloWorld程... 阅读全文
posted @ 2014-08-15 21:24 Champion Lai 阅读(184) 评论(0) 推荐(0) 编辑

2014年8月12日

摘要: Singleton Model是一个比较简单的模式,类图结构也很简单,不过实现却是有好几个版本。 为什么会有单例模式?在一些共享资源上,他要求全局一致的处理结构。一些全局的资源,比如线程池,缓冲区等需要又要给类来管理这些资源,这个类实例化时候只能实例化一个,否则如果出现多个实例会出现多个对象对... 阅读全文
posted @ 2014-08-12 20:09 Champion Lai 阅读(299) 评论(0) 推荐(0) 编辑

2014年8月6日

摘要: 工厂模式看英文书的时候挺纠结的,Head First里面感觉讲得很乱,都快看不下去了,看中文别人总结的,一条主线马上就出来了。工厂模式主要分三种1) simple factory model (static factory model) 2)factory method model 3)abstar... 阅读全文
posted @ 2014-08-06 20:35 Champion Lai 阅读(249) 评论(0) 推荐(0) 编辑

2014年8月3日

摘要: @Id @GeneratedValue(strategy=GenerationType.IDENTITY) public int getId() { return id; } public void setId(int id) { this.id = id; }这段代码将ID设置成自动生... 阅读全文
posted @ 2014-08-03 11:35 Champion Lai 阅读(179) 评论(0) 推荐(0) 编辑

导航