usedate.cpp

来自「C++&datastructure书籍源码,以前外教提供现在与大家共享」· C++ 代码 · 共 32 行

CPP
32
字号
#include <iostream>#include "date.h"using namespace std;// show Date member functionsint main(){    Date today;    Date birthDay(7,4,1776);	Date million(1000000L);    Date badDate(3,38,1999);    Date y2k(1,1,2000);    cout << "today   \t: "  << today    << endl;    cout << "US bday \t: "  << birthDay << endl;    cout << "million \t: "  << million  << endl;    cout << "bad date \t: " << badDate  << endl << endl;        cout << y2k << " is a " << y2k.DayName() << endl << endl;        Date one = million - 999999L;    Date birthDay2000(birthDay.Month(), birthDay.Day(), 2000);    today++;        cout << "day one \t: "   << one << " on a " << one.DayName() << endl;    cout << "bday2K  \t: "   << birthDay2000 << endl;    cout << "tomorrow \t: "  << today << endl;        return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?