tryndate.cpp

来自「Since the field of object oriented progr」· C++ 代码 · 共 25 行

CPP
25
字号
                             // Chapter 7 - Program 11 - TRYNDATE.CPP
#include <iostream.h>
#include "newdate.h"

int main(void)
{
new_date now, later, birthday;

   later.set_date(12, 31, 1991);
   birthday.set_date(2, 19, 1991);

   cout << "Today is day " << now.get_day_of_year() << "\n";
   cout << "Dec 31 is day " << later.get_day_of_year() << "\n";
   cout << "Feb 19 is day " << birthday.get_day_of_year() << "\n";

   return 0;
}


// Result of execution

// Today is day 135
// Dec 31 is day 365
// Feb 19 is day 50

⌨️ 快捷键说明

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