cfnr.net
当前位置:首页 >> 编写一个C++程序:两个类TimE和DAtE,派生TimE DAtE... >>

编写一个C++程序:两个类TimE和DAtE,派生TimE DAtE...

#include using namespace std; class Time { public: Time(int h,int m,int s):hour(h),minute(m),sec(s){} void display(){cout

CString str = ""; GetDlgItem(IDC_DATETIMEPICKER1)->GetWindowText(str); AfxMessageBox(str);

#include using namespace std; class Date { int year; int month; int day; public: Date(int year=2000,int month=1,int day=1) { this->year=year; this->month=month; this->day=day; } void setYear(int year) { this->year=year; } int g...

#include using namespace std; class Time {public:Time(int h,int m,int s):hour(h),minute(m),sec(s){} void display() {cout

#include using namespace std; class Date//定义日期类 {public: Date(int,int,int);//声明构造函数 friend void display(Date &);//声明友元函数显示日期 private: int year;//定义年 int month;//定义月 int day;//定义日 }; class Time//定...

完整代码如下: 编译器版本:VS2012 #include#include#includeusing namespace std;class Date{public: Date(int y, int m, int d) { tm_year = y; tm_month = m; tm_mday = d; } Date(const Date& D) { tm_year = D.tm_year; tm_month = D.tm_m...

#include using namespace std;class Date{ int year, month, day;public: Date(); Date(int y, int n , int d); int getYear(); int getMonth(); int getDay(); void setDate(int y, int m, int d); void print(); void addoneDay();};Date::Da...

很简单的一个: #include using namespace std;class Date {public: Date(const Date &date) : y(date.y), m(date.m), d(date.d) {} Date(int yy = 0, int mm = 0, int dd = 0) :y(yy), m(mm), d(dd) {} void set(int yy, int mm, int dd) { y =...

#includeusing namespace std;class date{private: int year,month,day;public: void setnday() { coutmonth>>day; } void display() { cout

只是先了简单的功能 没做日期的处理 #include using namespace std; class CDate { private: int m_date; int m_month; int m_year; public: CDate():m_date(1),m_month(1),m_year(2011){}; ~CDate(){}; void setDate() { cin>>m_year>>m_month>...

网站首页 | 网站地图
All rights reserved Powered by www.cfnr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com