码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
首尾相连最大子数组和(3)
#includeusing namespace std;#define Nu 5int main(){ int a[Nu]={1,2,3,-1,4}; cout=0) { b=a[j%Nu]; if(j=b) ...
分类:编程语言   时间:2015-04-16 13:50:30    阅读次数:148
【c++程序】static_cast和const_cast用法
#include using namespace std; #include//标准c++不带.h,说明来自c语言 //static_cast,const_cast,reinterpret_cast,dynamic_cast强制类型转换 //const_cast用于临时去掉const、volatile限制 int main() { //int n=3.21; int m=static_cast...
分类:编程语言   时间:2015-04-16 12:31:50    阅读次数:158
多继承的疑惑
#include using namespace std; class a { public: virtual void kk();//{}//虚函数是有函数体的 }; class P :virtual public a{ public: virtual void kk(){cout<<"pppppp";} }; class M :virtual public a{ public: ...
分类:其他好文   时间:2015-04-16 12:29:11    阅读次数:113
exercises 3.6
1 #include 2 #include 3 using namespace std; 4 5 6 int main() 7 { 8 string str("some thing"); 9 for(auto &c:str)10 if(!isspace(c)...
分类:其他好文   时间:2015-04-16 12:19:40    阅读次数:91
Codeforces 506E Mr. Kitayuta's Gift (矩阵乘法,动态规划)
描述:给出一个单词,在单词中插入若干字符使其为回文串,求回文串的个数(|s|#include#include#includeusing namespace std;#define maxn 410#define mod 10007typedef int ll;struct marix{ int...
分类:其他好文   时间:2015-04-16 12:18:58    阅读次数:219
代理模式
#include #include using namespace std;typedef struct _ShoolGirl { string name;} ShoolGirl;/* 公共接口 */class GiveGift { virtual void GiveDolls() = ...
分类:其他好文   时间:2015-04-16 12:11:35    阅读次数:110
Windows Service调试
两种方法:1. 安装Service,然后将VS附加到该Service进行调试。2.修改Program.cs文件。 1 namespace MyProject.Service 2 { 3 static class Program 4 { 5 /// 6 ...
分类:Windows程序   时间:2015-04-16 12:10:02    阅读次数:143
ZOJ3784 String of Infinity 高大上的AC自动机 数据原来这么水啊!不算输入输出只有5-7行
找给定s集合里面word全部是同一个字符的,这样的word有几个,如果数量#include#include#includeusing namespace std;int main(void){ int t; string a; cin>>t; while(t--) { ...
分类:其他好文   时间:2015-04-16 12:04:20    阅读次数:167
Codeforces 492E Vanya and Field(拓展欧几里得)
题目链接:Codeforces 492E Vanya and Field 通过拓展欧几里得算法求出每个位置在移动过程中,在x为0时,y的位置。统计相应y坐标最多的即为答案。 #include #include #include using namespace std; const int maxn = 1e6 + 5; const int maxm = 1e5 + 5; typedef...
分类:其他好文   时间:2015-04-16 10:21:14    阅读次数:119
复制构造函数和析构函数经典例子
#include using namespace std; class A { public: A() { cout<<"this is construction"<<endl; } virtual ~A() { cout<<"this is destruction"<<endl; } }; A fun() { A a; return a; } int main() { ...
分类:其他好文   时间:2015-04-16 10:18:30    阅读次数:125
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!