?? h5.cpp
字號:
using namespace std;class Date{private: int a,b;public: Date(int ax=0,int bx=0); //構(gòu)造函數(shù) void show(); //訪問數(shù)據(jù) int Min_GBS(); //公倍數(shù) int Max_GYS(); //公約數(shù) void print(); //輸出};//方法實現(xiàn)如下:Date::Date(int ax,int bx){ a=ax; b=bx;}int Date::Max_GYS(){ int ax=a,bx=b,temp; while(bx!=0) { temp=ax%bx; ax=bx; bx=temp; } return ax;}int Date::Min_GBS(){ return (a*b)/Max_GYS();}void Date::show(){ cout<<"Dates are "<<a<<","<<b<<endl;}void Date::print(){ cout<<"GYS is "<<this->Max_GYS()<<endl; cout<<"GBE is "<<this->Min_GBS()<<endl;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -