扩大
缩小

2012年12月17日

输出全班学生的信息

摘要: 1 /* 2 2 功能Function Description: 解决老师给的问题; 3 3 开发环境Environment: DEV C++ 4.9.9.1 4 4 技术特点Technique: 5 5 版本Version: 6 6 作者Author: 遥感专业赵杰迪 7 7 日期Date: 20121114 8 8 备注Notes: 主要纠结与随机数怎样产生,后来发现产生... 阅读全文

posted @ 2012-12-17 17:12 LinuxPanda 阅读(464) 评论(0) 推荐(0) 编辑

继承类调用顺序

摘要: 1 #include<iostream.h> 2 class A 3 { 4 private: 5 int a; 6 public: 7 int Get(){cout<<"A.Get()被调用!"<<endl;return a;} 8 }; 9 class B1:virtual public A10 {11 private:12 int b1;13 public:14 int Get(){cout<<"B1.Get()被调用!"<<en... 阅读全文

posted @ 2012-12-17 17:10 LinuxPanda 阅读(261) 评论(0) 推荐(0) 编辑

静态变量动态变量全局变量局部变量

摘要: 1 #include<iostream.h> 2 int i;//定义的全局变量 3 void change() 4 { 5 //int i=0;//在此处定义了i,屏蔽了全局变量i,如果此处不定义;结果又是另外一种情况的; 6 static j=0; 7 int k=0; 8 cout<<"i="<<i<<" j="<<j<<" k="<<k<<endl; 9 i+=1;10 j+=2;11 k+=4;12 cout<<&qu 阅读全文

posted @ 2012-12-17 17:09 LinuxPanda 阅读(801) 评论(0) 推荐(0) 编辑

构造函数和析构函数

摘要: 1 #include<iostream> 2 using namespace std; 3 class point 4 { 5 private: 6 float x,y; 7 public: 8 9 point(float a=1,float b=1)//缺省构造;10 {11 x=a;12 y=b;13 cout<<"缺省构造函数point(float a=1,float b=1)已经调用"<<endl;14 }15 /* point() //缺省构造16 ... 阅读全文

posted @ 2012-12-17 17:07 LinuxPanda 阅读(225) 评论(0) 推荐(0) 编辑

运算符重载实现复数的加减乘除

摘要: 代码写的有点乱了,嘿嘿;中间用到了复数的除法参考网站http://baike.baidu.com/view/1596407.htm下面是代码: 1 #include<iostream.h> 2 class plural 3 { 4 private: //定义私有变量——实部,虚部; 5 double real; 6 double imag; 7 public: 8 plural(double r=0.0,double i=0.0){real=r;imag=i;}//初始化; 9 double showreal(... 阅读全文

posted @ 2012-12-17 13:56 LinuxPanda 阅读(3671) 评论(0) 推荐(0) 编辑

导航