算年龄差:
#include<iostream>
#include <iomanip>
using namespace std;
#include<string>
#define M 12
class Date {
public:
Date(int year = 1990, int month = 1, int day = 1);
void setDate(int year, int month, int day);
void setYear(int year);
int getYear();
void setMonth(int month);
int getMonth();
void setDay(int month);
int getDay();
void setSeparator(char separator);
void printFullYear();
void printStandardYear();
int fullYearsTo(int year, int month, int day);
int daysTo(int year, int month, int day);
private:
int year;
int month;
int day;
char separator;
};
int main() {
Date birthDate(1969, 8, 11);
birthDate.printFullYear();
birthDate.printStandardYear();
birthDate.setSeparator('/');
birthDate.printFullYear();
cout << birthDate.fullYearsTo(2010, 4, 15)<<endl;
cout << birthDate.daysTo(2010,4,15)<<endl;
cout << birthDate.daysTo(1949,