码迷,mamicode.com
首页 >  
搜索关键字:using    ( 53562个结果
数据结构 顺序表的实现
首先是main.cpp让我们来看看都有什么函数 #include #include"SeqList.h" using namespace std; int main() { SeqList mylist; InitSeqList(&mylist); int select = 1; ElemType item = 0; ElemType pos...
分类:其他好文   时间:2015-04-25 16:45:44    阅读次数:139
将一个数转化为二进制后,求其中1的个数 C++
#include using namespace std;int func(int x){ int count=0; while(x) { x=x&(x-1);//与的次数就是包含1的个数 count++; } return count;}void main(){ int x; cin>>x; .....
分类:编程语言   时间:2015-04-25 16:29:27    阅读次数:130
Integrating .so files into your APK
With the recent changes (release 0.7.3 around Dec 27), thenew Android Build Systemstarts to be really interesting also if you are using the NDK!0.7.2:...
分类:其他好文   时间:2015-04-25 16:23:54    阅读次数:170
c++设计模式---代理模式
#include using namespace std; //代理模式中注意代理虽然可以实现某个功能,但是代理并不具备该功能,它的实现是通过调用别人的功能 //至于具体哪个功能,多态中基类指针指派生类对象,指向哪个派生类,就去调用哪个派生类的fun函数 class Base { public :virtual void fun()=0; virtual ~Base(){} ...
分类:编程语言   时间:2015-04-25 15:15:54    阅读次数:162
c++设计模式---适配器模式
#include using namespace std; //适配器模式,通过调用第三方类库实现软件功能 //基类Base class Base { public :virtual void process()=0;//process()为纯虚函数,多态 virtual ~Base(){} }; //Adaptee类中的Request()函数已经实现了A...
分类:编程语言   时间:2015-04-25 15:12:49    阅读次数:164
HDU ACM 1827 Summer Holiday->强连通分量+缩点(tarjan算法)
分析:首先求强连通分量的个数,然后进行缩点,最后求出最终答案。 1、求强连通分量的个数使用tarjan算法。 2、缩点为另外一个图,通过tarjan算法求出的结果进行。缩点后的图中求出每个点的入度。 3、求出每个强连通分量中的最小花费。 4、根据缩点后图的入度求出最终结果。 #include #include #include using namespace std; vect...
分类:编程语言   时间:2015-04-25 15:12:01    阅读次数:182
HDU ACM 1269迷宫城堡->有向强连通分量(tarjan算法实践)
分析:本题判断一个图是否是有向强连通分量,这里使用tarjan算法求解。 #include #include #include using namespace std; vector map[10002]; stack tarjan_stack; int low[10002]; int dfn[10002]; bool vis[10002]; int cnt,pos; void Init(i...
分类:编程语言   时间:2015-04-25 13:46:55    阅读次数:150
单词的长度
#include using namespace std; int main() { char a[100]; int num=0; int word=0; char c; int i,j=0; gets(a); for(i=0;(c=a[i])!='\0';i++) { if(c==' ') { word = 0;                    } ...
分类:其他好文   时间:2015-04-25 12:19:45    阅读次数:129
【c++】实现一个复数类
// 实现一个复数类(complex) //要求:1:实现不带参 / 带参数 /带默认参数的几种构造函数。 // 2:实现拷贝构造 / 析构函数。 #include using namespace std; // 带参数的构造函数 class complex { private: double _real; double _image; public: void p...
分类:编程语言   时间:2015-04-25 12:15:30    阅读次数:122
hdu 2566 统计硬币
已知:1,2元的硬币共n枚,能表示的钱数为[n,2n]。所以,每次去掉5元,如果剩下的钱能用1,2元表示,结果就+1。 1 #include 2 #include 3 using namespace std; 4 5 const int MAXN=1000000; 6 7 int main(...
分类:其他好文   时间:2015-04-25 12:07:35    阅读次数:106
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!