高级程序设计(c++)

2025-06-28 05:33:46
推荐回答(1个)
回答1:

//birthday.h
#ifndef BITRHDAY_H_
#define BITRHDAY_H_
class birthday
{
    int year,month,day;
public:
    birthday();
    birthday(int y, int m, int d);
    void set(int y, int m, int d);
    void show()const;
};
#endif //!_BITRHDAY_H_
//birthday.cpp
#include "birthday.h"
#include 
birthday::birthday():year(1990),month(01),day(01)
{
    //1234 2234
}
birthday::birthday(int y, int m, int d):year(y),month(m),day(d)
{
    //1234 2234
}
void birthday::set(int y, int m, int d)
{
    year = y;
    month = m;
    day = d;
}
void birthday::show()const
{
    std::cout<}