码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
一段代码引起的对C++构造函数、析构函数,复制构造函数,运算符重载的深度理解
代码和解释: #include "stdafx.h" #include #include #include using namespace std; class test{ int *p; public: test(int value){ p = new int(value); cout>"<<endl; cout<<"p的地址为"<<&p<<";p的值为"<<p <<" ...
分类:编程语言   时间:2014-09-03 22:46:37    阅读次数:203
HDU-4841 圆桌问题 STL模拟约瑟夫问题
中文题,题意一看就是卧槽,这不约瑟夫么,然后脑子一抽就用了链表写,然后果然T了,最后用Vector模拟的约瑟夫问题。 #include #include #include #include #include #include #include #include #define LL __int64 using namespace std; int n,m; vectorp; in...
分类:其他好文   时间:2014-09-03 22:43:57    阅读次数:227
hdu1878 欧拉回路
1 //Accepted 1240 KB 250 ms 2 //水题 欧拉回路 3 //连通+节点度均为偶数 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 const int imax_...
分类:其他好文   时间:2014-09-03 22:30:27    阅读次数:187
HDU 4707 水DFS
所有房子组成一颗树,求出离根节点0的距离大于d的节点数目 DFS+vector存边 水过 #include "stdio.h" #include "string.h" #include "vector" using namespace std; vectormapp[100010]; int ans,d; void dfs(int cur,int pre,int op) { ...
分类:其他好文   时间:2014-09-03 21:21:39    阅读次数:344
HDU 4686
再不能直视这道题,换INT64就过了。。。。。。。同样可以使用矩阵的方法。构造1*5的D[N],a[n],b[n],a【n】*b[n],1接着你应该就会了。#include #include #include #define LL __int64using namespace std;const L...
分类:其他好文   时间:2014-09-03 21:16:47    阅读次数:230
【C语言】数组名传递给函数,数组的sizeof变为4的原因
C语言中,数组名作为参数传递给函数时,退化为指针,sizeof对指针操作结果应该是4。例子如下:#includeusing namespace std;void Swap_arr(char* charArr){ int len = sizeof(charArr); cout usin...
分类:编程语言   时间:2014-09-03 21:01:47    阅读次数:197
(白书训练计划)UVa 120 Stacks of Flapjacks(构造法)
题目地址:UVa 120 水题。从最大的开始移,每次都把大的先翻到最上面,再翻到下面。 代码如下: #include #include #include #include #include #include #include #include #include #include #include using namespace std; int a[500], b[5...
分类:其他好文   时间:2014-09-03 19:54:27    阅读次数:262
hdu--4947--我太天真了
这题 我还没有解决如果 谁恰好看到这篇 有好的解决方案 不妨底下留言告诉我-----------------------我看到时间限制是 5500ms 总觉得肯定能过的 1 #include 2 #include 3 using namespace std; 4 5 const int siz...
分类:其他好文   时间:2014-09-03 19:49:57    阅读次数:318
流随机访问
17.39#include#include#include#includeusing namespace std;int main(){ fstream inOut("copyOut",fstream::ate|fstream::in|fstream::out); if(!inOut) ...
分类:其他好文   时间:2014-09-03 19:38:37    阅读次数:198
【wikioi1006】等差数列
1006 等差数列题目描述Description给定n(1#include#include#includeusing namespace std;int main(){ int a[105]; int n,large; cin>>n; large=0; for (in...
分类:其他好文   时间:2014-09-03 19:34:27    阅读次数:904
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!