⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usedttm.cpp

📁 含有文章和源码
💻 CPP
字号:
                                     // Chapter 9 - Program 5
#include <iostream.h>
#include "datetime.h"

datetime now, birthday(10, 18, 1938,  1, 30, 17);
datetime       special( 2, 19, 1950, 13, 30,  0);

void main(void)
{

   cout << "Now = " << now.get_date_string() << " "
                    << now.get_time_string() << " and is day "
                    << now.get_day_of_year() << "\n";

   cout << "Birthday = " << birthday.get_date_string() << " "
                    << birthday.get_time_string() << " and is day "
                    << birthday.get_day_of_year() << "\n";

   cout << "Special = " << special.get_date_string() << " "
                    << special.get_time_string() << " and is day "
                    << special.get_day_of_year() << "\n";

}



// Result of execution

// Now = Jan 20, 1992 21:12:56 and is day 20
// Birthday = Oct 18, 1938  1:30:17 and is day 291
// Special = Feb 19, 1950 13:30:00 and is day 50

⌨️ 快捷键说明

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