第五章派生
文章平均质量分 75
caita_
新手学编程酱菜141
展开
-
时间加减运用派生和重载
#include #include using namespace std; class Time { public: void display(){cout<<hour<<":"<<minute<<":"<<sec<<endl;} protected: int hour; int minute; int sec; }; class Date { public: void display原创 2015-05-05 22:46:54 · 382 阅读 · 0 评论 -
第五章3
#include using namespace std; class Student {public: void get_value(); void display( ); protected :原创 2015-05-17 21:54:10 · 483 阅读 · 0 评论 -
第五章10
#include #include using namespace std; class Teacher {public: Teacher(int,char [],char); void display(); private:原创 2015-05-17 22:07:55 · 300 阅读 · 0 评论 -
第五章9
#include #include using namespace std; class Teacher {public: Teacher(string nam,int a,char s,string tit,string ad,string t); void display(); protected: string name; int ag原创 2015-05-17 22:03:29 · 424 阅读 · 0 评论 -
第五章1
#include #include using namespace std; class Student { public: void display() { cout<<"num:"<<num<<endl; cout<<"name:"<<name<<endl; cout<<"sex:"<<sex<<endl; } void setStu(){cin>>原创 2015-05-12 20:46:03 · 326 阅读 · 0 评论 -
第五章2
#include using namespace std; class Student {public: void get_value() {cin>>num>>name>>sex;} void display( ) {cout<<"num: "<<num<<endl; cout<<"name: "<<name<<endl; cout<原创 2015-05-17 21:50:23 · 247 阅读 · 0 评论