首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
设计Dog类 代码参考
】的更多相关文章
设计Dog类 代码参考
#include <iostream> #include <string> using namespace std; class Dog { private: string name; int age; char sex; double weight; public: void GetName(){cin>>name;return;} void GetAge(){cin>>age;return;} void GetSex(){cin>>sex;r…
设计带构造函数的Dog类 代码参考
#include <iostream> #include <string> using namespace std; class Dog { private: string name; int age; char sex; double weight; public: Dog(string,int,char,double); void GetName(){cin>>name;return;} void GetAge(){cin>>age;return;} v…
设计Person类 代码参考
#include <iostream> using namespace std; class Trapezium { private: int x1,y1,x2,y2,x3,y3,x4,y4; public: void initial(){x1=,x2=;x3=;x4=;y1=;y2=;y3=;y4=;return;} void GetPosition(int&,int&,int&,int&,int&,int&,int&,int&…
设计MyTime类 代码参考
#include <iostream> #include <cstdio> using namespace std; class MyTime { private: int hour; int minute; int second; public: void SetTime(){cin>>hour>>minute>>second;return;} void print_12(); void print_24(); }; void MyTime::…
设计Weekday类 代码参考
#include <iostream> using namespace std; class Weekday { private: int num; public: void SetDay(){cin>>num;return;} void IncDay(){num+=;if(num>) num-=;return;} void NowDay() { switch(num) { case :cout<<"星期日"<<endl;break…
设计一个多功能的MyTime类 代码参考
#include <iostream> #include <cstdio> using namespace std; class MyTime { private: int hour; int minute; int second; public: MyTime(){hour=;minute=;second=;} MyTime(int,int,int); void Register(int,int,int); void Show_12(); void Show_24(); void…
设计并测试Trapezium类 代码参考
#include <iostream> using namespace std; class Trapezium { private: int x1,y1,x2,y2,x3,y3,x4,y4; public: void initial(){x1=,x2=;x3=;x4=;y1=;y2=;y3=;y4=;return;} void GetPosition(int&,int&,int&,int&,int&,int&,int&,int&…
从Student类和Teacher类多重派生Graduate类 代码参考
#include <iostream> #include <cstring> using namespace std; class Person { private: char Name[]; char Sex; int Age; public: void Register(char *name, int age, char sex); void ShowMe(); }; void Person::Register(char *name, int age, char sex) {…
从Point类继承的Circle类 代码参考
#include <iostream> #include <cstring> using namespace std; class Point { private: int x,y; public: Point(int,int); void SetPoint(int,int); int GetX(){return x;} int GetY(){return y;} void Print(); }; class Circle:public Point { private: doubl…
一个基类Person的多个派生类 代码参考
#include <iostream> #include <cstring> using namespace std; class Person { protected: char Name[]; char Sex; int Age; public: void Register(char *name, int age, char sex); void ShowMe(); }; class Teacher:public Person { private: char Dept[]; i…