当前位置: 首页 > news >正文

网站建设 书籍下载购物网站建设得背景

网站建设 书籍下载,购物网站建设得背景,济南建设工程有限公司,替人做赌彩网站目录 前言#xff1a; 头文件类与函数的定义Date.h 实现函数的Date.cpp 测试Test.cpp 运行结果#xff1a; 前言#xff1a; 我们在前面的两章初步学习认识了《类与对象》的概念#xff0c;接下来我们将实现一个日期类#xff0c;是我们的知识储备更加牢固。 头文件…目录 前言 头文件类与函数的定义Date.h 实现函数的Date.cpp 测试Test.cpp 运行结果 前言 我们在前面的两章初步学习认识了《类与对象》的概念接下来我们将实现一个日期类是我们的知识储备更加牢固。 头文件类与函数的定义Date.h #pragma once #define _CRT_SECURE_NO_WARNIGS 1 #includeiostream using namespace std;class Date { public:friend ostream operator(ostream out, const Date d);int GetMonthDay(int _year, int _month){int day[13] { 0,31,28,31,30,31,30,31,31,30,31,30,31 };if ((_year % 4 0) (_year % 100 ! 0) || (_year % 400 0)){day[2] 29;}return day[_month];}Date(int year 2000, int month 1, int day 1){if (month 12 || day GetMonthDay(year, month)){cout Setting error!!! endl;exit(-1);}_year year;_month month;_day day;}bool operator(const Date d);bool operator!(const Date d);bool operator(const Date d);bool operator(const Date d);bool operator(const Date d);bool operator(const Date d);Date operator(int day);Date operator(int day);Date operator();Date operator(int);Date operator-(int day);Date operator-(int day);Date operator--();Date operator--(int);int operator-(const Date d); private:int _year;int _month;int _day; }; 实现函数的Date.cpp #includeData.h bool Date::operator(const Date d) {return (_year d._year) (_month d._month) (_day d._day); } bool Date::operator!(const Date d) {return !(*this d); } bool Date::operator(const Date d) {if (_year d._year){return true;}else if (_year d._year){return false;}if (_month d._month){return true;}else if (_month d._month){return false;}if (_day d._day){return true;}return false; } bool Date::operator(const Date d) {return (*this d) || (*this d); }bool Date::operator(const Date d) {return !(*this d); } bool Date::operator(const Date d) {return !(*this d); }Date Date::operator(int day) {_day day;while (_day GetMonthDay(_year, _month)){_day - GetMonthDay(_year, _month);_month;if (_month 13){_month 1;_year;}}return *this; }Date Date::operator(int day) {Date tmp *this;tmp day;return tmp; }Date Date::operator() {*this 1;return *this; } Date Date::operator(int) {Date tmp *this;*this 1;return tmp; }Date Date::operator-(int day) {_day - day;while (_day 0){_month--;if (_month 0){_month 12;_year--;}_day GetMonthDay(_year, _month);}return *this; }Date Date::operator-(int day) {Date tmp *this;tmp - day;return tmp; }Date Date::operator--() {*this - 1;return *this; }Date Date::operator--(int) {Date tmp *this;*this - 1;return tmp; }int Date::operator-(const Date d) {int flag 1;Date max *this;Date min d;if (max min){max d;min *this;flag -1;}int count 0;while (max ! min){min;count;}return flag * count; }ostream operator(ostream out, const Date d) {out d._year 年 d._month 月 d._day 号;return out; } 测试Test.cpp #includeData.h int main() {Date d1(2024, 3, 10);cout d1 endl;Date d2(2024, 6, 17);cout d2 endl;printf(相差天数);cout (d2 - d1) endl;return 0; } 运行结果
http://www.w-s-a.com/news/679789/

相关文章:

  • 北京网站建设公司服务哪家好wap是什么意思?
  • 怎么看公司网站做的好不好哦wordpress页面目录下
  • 做装修业务呢有多少网站平台搭建是什么
  • 潍坊优化网站排名淘宝做网站被骗
  • 建设专业网站的利弊免费logo设计生成器下载
  • 怎么在备案号添加网站网页设计动画网站
  • 网站开发 只要wordpress滑动注册
  • 跨境电商运营主要做什么静态网站如何做优化
  • 南充网站建设网站网站备案安全责任书是谁盖章
  • 怎么将网站设置为首页网站子目录怎么做
  • 做网站交互wordpress信息导出
  • 如何自己做企业网站做外贸登录国外网站
  • 郑州炫彩网站建设网站集约化建设调研报告
  • 2016年两学一做教育网站优良的定制网站建设制作商
  • 自己做网站需要哪些流程网站建设服务费如何做会计分录
  • 莆田建站培训用手机制作游戏的app软件
  • 中山建网站找哪家wordpress采集图片插件
  • 网站首页做后台链接有什么好用的模拟建站软件
  • 宁波有没有开发网站的公司网站上线除了备案还需要什么
  • 网站备案授权wordpress默认主体设置
  • 厦门微信网站广州推广策划公司
  • 集团公司网站开发asp网站怎么运行
  • 广州短视频网站开发东莞市建设信息网
  • 建设网站如果赚钱电脑可以做服务器部署网站吗
  • 网站建设的编程专门做面包和蛋糕的网站
  • 档案网站建设比较分析南京建站公司
  • 哪个网站可以做店招傻瓜式wordpress
  • 网站开发项目经理职责青岛模版网站建设
  • 企业建站哪个好网站建设所用程序
  • 网站建设seo视频定制图片软件