码迷,mamicode.com
首页 >  
搜索关键字:const 常量    ( 36792个结果
24点 C/C++代码
#include#include#includeusing namespace std;const double PRECISION = 1E-6;const int COUNT = 4;const int RESULT = 24;double number[COUNT]; //这里一定要用...
分类:编程语言   时间:2014-05-16 07:12:29    阅读次数:350
C语言的时间函数
---恢复内容开始---下面是C语言的获取本地时间和构造时间进行格式化时间显示输出的相关函数:This page is part of release 3.35 of the Linux man-pages project.#include char *asctime(const...
分类:编程语言   时间:2014-05-15 16:40:30    阅读次数:300
ZOJ 3640 Help Me Escape
OJ题目:click here~~ 题目分析:有n条路径逃出洞穴,第i条路径有一个难度值ci。某人开始有战斗值f,每天随机选择某一条路径想要逃出。只要此时的 f 大于所选路径的ci,就能花费ti的天数逃出。这里。否则,等待明天再试吧,但是战斗值能增加ci。求逃出的期望天数。 设dp[ i ] 为战斗值为i时,逃出的期望天数。详细解释见代码。 AC_CODE int const maxn =...
分类:其他好文   时间:2014-05-15 06:38:40    阅读次数:406
hdu AC me
/* * hdu AC Me * date 2014/5/13 * state AC */ #include #include #include #include using namespace std; const int MAXN=100001; char Arr[MAXN]; int cnt[26]; int main() { //cout << "Hello wor...
分类:其他好文   时间:2014-05-15 06:16:24    阅读次数:247
C++ Primer 学习笔记_70_面向对象编程 --纯虚函数、容器与继承
面向对象编程--纯虚函数、容器与继承I.纯虚函数 在函数形参后面写上 =0 以指定纯虚函数:class Disc_item : public Item_base { public: double net_price(size_t) const = 0; //指定纯虚函数 }; 将函数定义为纯虚函数能够说明,该函数为后代类型提供了可以覆盖的接口,但是这个类的版本绝不会调用。重要的是,用户将不...
分类:编程语言   时间:2014-05-15 05:50:43    阅读次数:316
备忘之 拷贝构造函数
//拷贝构造函数,什么时候算是 “合适的时候”,才会合成呢~~~ #include using namespace std; class A { public:     A(char *_str):str(_str),x(0){}     //A(const A&a){cout     //如果没有定义的话,对于类A来说,编译器依然不会合成,因为此时的对象之间的...
分类:其他好文   时间:2014-05-15 05:11:13    阅读次数:334
HDU 4285 circuits
插头DP。 题目要求构造出K条回路的方案数,而且不能出现环套环。 Sol:通过增加标记为来记录形成的回路数,假如不形成环的话就是在形成新的环路,此时,两边的插头个数要为偶数。 #include #include #include #include using namespace std; const int MAXD=15; const int STATE=1000010; const i...
分类:其他好文   时间:2014-05-15 03:53:23    阅读次数:272
UVa 10308 Roads in the North 树的直径
题目来源:UVa 10308 Roads in the North 题意:求距离最远的2点之间的距离 思路:裸的树的直径 或者树形DP #include #include #include using namespace std; const int maxn = 100010; struct node { int to, w; node(){} node(int to, int...
分类:其他好文   时间:2014-05-15 03:37:18    阅读次数:295
php 设置报错等级
定义和用法: error_reporting() 设置 PHP 的报错级别并返回当前级别。函数语法: error_reporting(report_level)如果参数 level 未指定,当前报错级别将被返回。下面几项是 level 可能的值: 值 常量 描述 1 E_ERROR ...
分类:Web程序   时间:2014-05-14 12:17:34    阅读次数:321
operator->
在学习Stl的过程中,经常看到->符号的重载,但一直不太明白。 今天做了一个小测试,来看看如果调用它。 以list的迭代器为例,在 pointer operator->() const { return &(operator*());}中加入 cout str_list; str_list.push...
分类:其他好文   时间:2014-05-14 10:32:52    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!