- 博客(6)
- 收藏
- 关注
原创 第十五周 任务一
MyTriangle.h class Triangle { public: Triangle(){a=1;b=1;c=1;} Triangle(double x, double y, double z) {a=x; b=y; c=z;} double area(void); double perimeter(void); private: double a,b,c;
2012-05-28 19:17:18 664 1
原创 第十四周 任务一
#include using namespace std; class MyArray { private: int *arr; //用于存放动态分配的数组内存首地址 int size; //数组大小 public: MyArray(int sz=50); MyArray(int a[],int sz); //由一个内置类型的数组初始化 MyArray(const
2012-05-21 18:37:37 576
原创 第十三周 任务二
#include "iostream" #include using namespace std; class Animal { public: virtual void cry() {cout<<"不知哪种动物,让我如何学叫?"<<endl;} }; class Mouse :public Animal { public: void cry() {cout<<"我叫Je
2012-05-21 18:03:19 524
原创 第十三周 任务一
#include using namespace std; class Vehicle { public: void run() const { cout << "run a vehicle. "<<endl; } //(2) run()为虚函数 }; class Car: public Vehicle { public: void run() con
2012-05-14 18:46:37 547 1
原创 第十二周 任务二
#include #include #include using namespace std; class Teacher { public: Teacher(string nam,int Age,int Sex,char *Department, int phone,string title1); ~Teacher( ); void displa
2012-05-07 19:07:03 885
原创 第十二周 任务一
#include #include using namespace std; class Student //(1)修改student类中各数据成员和成员函数的访问限定符,并观察发生的现象 { public: Student(int n,string nam,char s) ; void show(); ~Student( ){ } protected:
2012-05-07 18:28:00 935 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人