2012年5月9日

NYOJ 题目5 字符串匹配

摘要: Binary String Matching时间限制:3000ms | 内存限制:65535KB难度:3描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as a substring of B? For example, the text string B is ‘1001110110’ while the pattern string A is ‘11’, you should output 3 阅读全文

posted @ 2012-05-09 23:21 thoupin 阅读(252) 评论(0) 推荐(0) 编辑

c++中子类父类的构造顺序

摘要: (本人菜鸟, 新学c++)通常情况下,基类及派生类(即父类及子类)都含有构造函数(创建类时调用)以及析构函数(删除类时调用)。那么, 当子类定义一个对象时, 他调用的构造函数以及析构函数的顺序是如何的呢?这是情况1下的代码:#include<iostream>using namespace std;class A { public: A() { cout << this << " new super\n"; } ~A() { cout << this << " delete super\n"; 阅读全文

posted @ 2012-05-09 22:27 thoupin 阅读(1055) 评论(0) 推荐(0) 编辑

导航