#include <iostream>
#include <string>
using namespace std;
class Date
{
public:
Date(int,int,int);
int getYear();
int getMonth();
int getDay();
private:
int year;
int month;
int day;
};
Date::Date(int Year,int Month,int Day):year(Year),month(Month),day(Day)
{
year=Year;
month=Month;
day=Day;
}
int Date::getYear()
{
return year;
}
int Date::getMonth()
{
return month;
}
int Date::getDay()
{
return day;
}
课本上的一道题,老师改了一下,上机操作总是有错误,不知道怎么改,请教大神,谢谢 老师要求身份证号改为成绩A,B,C,D,和日期一样做一个类,不需要使用内联函数。 不会引用只能复制粘贴,可能看起来比较麻烦,求大神帮帮忙啦!!! 谢谢!!! #include #include using namespace std; class Date { public: Date(int,int,int); int getYear(); int getMonth(); i