码迷,mamicode.com
首页 >  
搜索关键字:const    ( 26295个结果
C++必知必会(3)
条款26操作符函数查找 class X {        public:               Xoperator %( const X& ) const;             //二元取余操作               XmemFunc1( const X&);               voidmemFunc2(); }; 可以采用中缀或函数调用语法来调用这个重载...
分类:编程语言   时间:2014-06-05 12:31:55    阅读次数:311
字符串的分割操作(strtok,split)
一:strtok C/C++:char *strtok(char s[], const char *delim); s 代表需要分割的字符串,delim代表分割的标志,参数都为比选!返回指向分割部分的指针,如果没有分割成功就返回NULL. 一个简单的例子:...
分类:其他好文   时间:2014-06-05 10:01:51    阅读次数:139
POJ - 1111 Image Perimeters
题意:求'X'围成的周长 思路:按理说每增加一个就是周长加4,但是要减去重复的地方,这里我是用BFS做的,如果是BFS的模板思路的话是不行的,应该要先取出再标记 #include #include #include #include #include using namespace std; const int MAXN = 30; struct node { int x,y; ...
分类:其他好文   时间:2014-06-05 06:23:39    阅读次数:221
HDU 3367 Pseudoforest 最大生成树
题目来源:HDU 3367 Pseudoforest 题意:每个连通块最多可以有一个环 求最大的森林 思路:考虑最大生成树 如果祖先一样没有环 那就合并 如果祖先不一样 如果2棵树都没有环 合并 如果有1棵树有环 合并 标记该棵树有环 #include #include #include using namespace std; const int maxn = 100010; str...
分类:其他好文   时间:2014-06-05 05:35:03    阅读次数:261
Cocos2d-x3.0TestCpp目录笔记(二)
3.Actions-Basic:此demo中体现ccp由Point代替 ①ActionManual:直接设置精灵的属性demo。 const Color3B Color3B::RED    (255,   0,   0); const Color3B Color3B::GREEN  (  0, 255,   0); const Color3B Color3B::BLUE   (  0,  ...
分类:其他好文   时间:2014-06-05 03:49:02    阅读次数:225
Light OJ 1258 Making Huge Palindromes 末尾添加最少字符变回文串
题目来源:Light OJ 1258 Making Huge Palindromes 题意:末尾添加最少的字符是使输入的串变成回文 输出长度 思路:直接KMP匹配出它和它反串的最大匹配 n减去它就是要添加的数量 #include #include #include using namespace std; const int maxn = 1000010; char a[maxn], ...
分类:其他好文   时间:2014-06-05 01:14:56    阅读次数:240
14周 项目3 立体类族共有的抽象类
#include using namespace std; class CSolid { public: virtual double area() const=0; virtual double volume() const=0; }; class CCube:public CSolid { public: CCube(double s):...
分类:其他好文   时间:2014-06-04 23:22:58    阅读次数:270
形状类的纯虚函数
/* * Copyright (c) 2013, 烟台大学计算机学院 * All rights reserved. * 作 者:马广明 * 完成日期:2014 年 5 月 27 日 * 版 本 号:v1.0 * 问题描述:形状类中的纯虚函数 */ #include using namespace std; const double PI=3.14; class Sha...
分类:其他好文   时间:2014-06-04 22:02:45    阅读次数:234
Tire
字符串模板第一发,Tire(前缀树)。 1 const int maxnode = 4005*100; 2 const int sigma_size = 30; 3 4 class tire{ 5 public: 6 int ch[maxnode][sigma_size]; 7 i...
分类:其他好文   时间:2014-05-31 07:38:45    阅读次数:239
Hash poj2002 Squares
仿照之前的雪花,Hash函数随便搞个。#include #include #include #include #include #include #include #include #include #include #include const int INF = 9973;const int k...
分类:其他好文   时间:2014-05-31 06:53:35    阅读次数:263
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!