上一页 1 ··· 20 21 22 23 24
摘要: #include <cstdlib>#include <iostream>#include <time.h> using namespace std;int main(int argc, char *argv[]){ clock_t start=clock(); double spot; srand(time(0));//设定随机数种子 int n=100; // 产生100个随机数 int *p=new int[200];//开辟200个int空间 for(int i=0;i<100;i++)//产生100个0-150之间互相不相同的随机数 { p[ 阅读全文
posted @ 2013-04-28 17:35 夜雨阑珊 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #include <cstdlib>#include <iostream>using namespace std;class A{int m_a;};class B{int m_b;} ;class C:public A,public B{int m_c;};int main(int argc, char *argv[]){C *pc=new C;B *pb=dynamic_cast<B*>(pc);A *pa=dynamic_cast<A*>(pc);cout<<pc<<endl;//0x892a20cout<&l 阅读全文
posted @ 2013-04-17 12:30 夜雨阑珊 阅读(167) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24