码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
C++学习笔记29,引用变量(1)
引用变量在创建的时候就必须初始化。无法创建一个未被初始化的引用。 #include using namespace std; int main() { int x=10; int y=20; int &r1; } 编译结果: 如果引用未被初始化,编译将报错。 修改引用: 引用总是指向初始化的那个变量,也就是说,引用一旦被创建并初始化之后就无法改变。这一...
分类:编程语言   时间:2014-06-22 22:22:59    阅读次数:215
C++学习笔记30,指针的引用(2)
可以创建任何类型的引用,包括指针类型。 看一个简单的指针的引用的例子。例如: #include using namespace std; int main(){ int x=10; int y=20; int z=30; int* ptx=&x; int* ptz=&z; //指针的引用,声明从右往左看,rtp与&结合, //剩余的符号...
分类:编程语言   时间:2014-06-22 21:15:26    阅读次数:287
windows和linux下结束循环的操作
#include #include #include using namespace std; int main() { string word; string line; while (getline(cin,line)) { istringstream istr(line); while(istr>>word) cout<<wo...
分类:Windows程序   时间:2014-06-22 19:36:00    阅读次数:290
HDU 3085 Nightmare Ⅱ (双向广搜)
题意:有M,G两人和鬼魂(Z)在n*m的方格内,M每秒走3步,G每秒走一步,鬼魂每秒走2步,问是否能 不遇到鬼魂下两人相遇,鬼魂可以穿墙(X),人不可以。初始鬼魂有2个。 #include #include #include #include #include #include #include #define M 800 using namespace std...
分类:Web程序   时间:2014-06-22 18:57:14    阅读次数:189
poj-3744-Scout YYF I-矩阵乘法
f[i]=f[i-1]*p+f[i-2]*(1-p); 正好可以用矩阵加速。。。。 #include #include #include #include #include using namespace std; struct matr { double mat[3][3]; friend matr operator *(const matr a,const matr b) ...
分类:其他好文   时间:2014-06-22 18:23:06    阅读次数:173
C++学习笔记31,指向引用的指针(3)
我们来看一个简单的指向引用的指针的例子。 #include using namespace std; int main(){ int x=10; int y=20; int &rtx=x; //不要写成了int& *ptrx=&rtx; //因为rtx的本质是一个int int *ptrx=&rtx; *ptrx=15; ptrx...
分类:编程语言   时间:2014-06-22 14:41:42    阅读次数:272
HDU 4107 Gangster Segment Tree线段树
这道题也有点新意,就是需要记录最小值段和最大值段,然后成段更新这个段,而不用没点去更新,达到提高速度的目的。 本题过的人很少,因为大部分都超时了,我严格按照线段树的方法去写,一开始居然也超时。 然后修补了两个地方就过了,具体修改的地方请参看程序。 知道最大值段和最小值段,然后修补一下就能过了。不是特别难的题目。 #include #include #include using na...
分类:其他好文   时间:2014-06-21 20:14:04    阅读次数:230
Access text files using SQL statements by DB Query Analyzer
Is it a dream that you can access text files using SQL statements? But now, it is true that DB Query Analyzer provides you a power tool which can help you realize the dream above. I’ll give you a sample to show its powerful function. What’s more, the p...
分类:数据库   时间:2014-06-21 18:41:54    阅读次数:510
算法导论三剑客之 动态规划 0-1背包问题
1 #include "iostream" 2 using namespace std; 3 4 float MAX(float m1,float m2){ 5 if(m1>=m2) 6 return m1; 7 else 8 return m2;...
分类:其他好文   时间:2014-06-21 16:05:31    阅读次数:205
[转]Creating an IP Tunnel using GRE on Linux
Creating an IP Tunnel using GRE on Linux Contents[hide] · 1 IP Tunelling · 2 Starting Configuration · 3 Tunnelling Objective ...
分类:系统相关   时间:2014-06-21 15:27:26    阅读次数:598
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!