码迷,mamicode.com
首页 >  
搜索关键字:es6 let const    ( 43838个结果
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
【足迹C++primer】14、函数匹配、函数指针
函数匹配 1、实参类型转换 1.精确匹配 2.通过const转换实现的匹配 3.通过类型提升实现的匹配 4.通过算术类型转换或者指针转换 5.通过类类型转换实现的匹配 函数匹配和const实参 如果重载函数的区别在于它们的引用类型的形参是否引用了const,或者指针类型的形参是否指向const,则当调用发生时编译器通过实参是否是常量来决定选择哪个类型。 函数指针 使用函数指...
分类:编程语言   时间:2014-06-05 01:54:48    阅读次数:316
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
C++ this与const,const_cast,static_cast的关系
一、整体代码 #include using namespace std; class CCTest { public: void setNumber( int ); void printNumber() const ; private: int number; }; void CCTest::setNumber( int num ) { number = num; } ...
分类:编程语言   时间:2014-06-04 23:17:34    阅读次数:415
形状类的纯虚函数
/* * 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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!