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

有了域名公司网站怎么建设创建网站的步骤

有了域名公司网站怎么建设,创建网站的步骤,淄博天一建设项目招标代理有限公司网站,网站自己做还是找公司编程题#xff1a; 题一#xff1a;计算日期到天数的转换 计算日期到天数转换_牛客题霸_牛客网 (nowcoder.com) 示例1 输入#xff1a; 2012 12 31 输出#xff1a; 366 思路一#xff1a; 第一步#xff1a;创建年#xff0c;月#xff0c;日的变量#xff0c;并按… 编程题 题一计算日期到天数的转换 计算日期到天数转换_牛客题霸_牛客网 (nowcoder.com) 示例1 输入 2012 12 31 输出 366 思路一 第一步创建年月日的变量并按要求输入 第二步创建一个数组记录平年每个月的天数以及记录总天数的sum 第三步将除当前月的以外的天数记录在sum中再去判断是不是闰年是就1 第四步打印总天数。 #include iostream using namespace std;int main() {int _year,_month,_day;cin_year_month_day;int sum _day;int arr[13] {0,31,28,31,30,31,30,31,31,30,31,30,31};int n _month;while(--n){sum arr[n];}if(_month 2 ((_year % 4 0 _year % 100 ! 0) || (_year % 400 0)))sum 1;coutsumendl;return 0; } 思路二 第一步创建一个日期类私有成员变量有年月日 第二步创建一个构造函数给自定义类型的对象完成初始化创建一个赋值运算符重载 保证自定义类型的输入以及赋值运算符重载  自定义保证能够输出自定义类型的内容需要注意的是 需要声明为友元函数且在类外定义最后再创建一个函数得到当前年这个月的天数 第三步根据题意将输入的年月日转换成是这一年的第几天 #include iostream using namespace std;class Date {public://构造函数Date(int year 1,int month 1,int day 1){_year year;_month month;_day day;}//计算当前年月所对应的天数int GetMonth(int year,int month){int arr[13] {0,31,28,31,30,31,30,31,31,30,31,30,31};if(month 2 ((year % 4 0 year % 100 ! 0) || (year % 400 0))){return 29;}return arr[month];}//友元函数声明friend ostream operator(ostream out,Date d);friend istream operator(istream out,Date d);private:int _year;int _month;int _day; };//赋值运算符重载 ostream operator(ostream out,Date d) {int sum d._day;--d._month;while(d._month 0){sum d.GetMonth(d._year, d._month);--d._month;}outsumendl; return out; } istream operator(istream in,Date d) {ind._yeard._monthd._day;return in; }int main() {Date d1;cind1;coutd1endl;return 0; } 题二日期差值 日期差值_牛客题霸_牛客网 (nowcoder.com) 示例1 输入 20110412 20110422输出 11 思路一 #include iostream using namespace std; #include stdbool.hclass Date { public:Date(int year 1, int month 1, int day 1){_year year;_month month;_day day;}int GetMonth(int year, int month){int arr[13] { 0,31,28,31,30,31,30,31,31,30,31,30,31 };if (month 2 ((year % 4 0 year % 100 ! 0) || (year % 400 0))){return 29;}return arr[month];}bool operator!(Date d){return !(_year d._year _month d._month _day d._day);}bool operator(Date d){if (_year d._year){return true;}else if (_year d._year _month d._month){return true;}else if (_year d._year _month d._month _day d._day){return true;}return false;}Date operator(){_day;if (_day GetMonth(_year, _month)){_day _day - GetMonth(_year, _month);_month;if (_month 13){_year;_month 1;}}return *this;}int operator-(Date d){//int flag 1;Date max *this;Date min d;if (*this d){max d;min *this;//flag -1;}int n 0;while (min ! max){min;n;}return n 1;}friend ostream operator(ostream out, Date d);friend istream operator(istream out, Date d);private:int _year;int _month;int _day; };ostream operator(ostream out, Date d) {out d._year d._month d._day endl;return out; }istream operator(istream in, Date d) {scanf(%4d%2d%2d, d._year, d._month, d._day);return in; }int main() {Date d1;Date d2;cin d1;cin d2;cout d1 - d2;return 0; } // 64 位输出请用 printf(%lld) 题三打印日期 打印日期_牛客题霸_牛客网 (nowcoder.com) 示例1 输入 2000 3 2000 31 2000 40 2000 60 2000 61 2001 60输出 2000-01-03 2000-01-31 2000-02-09 2000-02-29 2000-03-01 2001-03-01 思路一 #include iostream using namespace std;class Date { public:Date(int year 1, int month 1, int day 1){_year year;_month month;_day day;}int GetMonth(int year, int month){int arr[13] { 0,31,28,31,30,31,30,31,31,30,31,30,31 };if (month 2 ((year % 4 0 year % 100 ! 0) || (year % 400 0))){return 29;}return arr[month];}void Calendar(){while (_day GetMonth(_year, _month)){_day _day - GetMonth(_year, _month);_month;if (_month 13){_year;_month 1;}}}friend ostream operator(ostream out, Date d);friend istream operator(istream out, Date d);private:int _year;int _month;int _day; };ostream operator(ostream out, Date d) {printf(%04d-%02d-%02d, d._year, d._month, d._day);return out; } istream operator(istream in, Date d) {scanf(%4d%d, d._year, d._day);return in; }int main() {Date d1;cin d1;d1.Calendar();cout d1;return 0; } // 64 位输出请用 printf(%lld) 题四日期累加 日期累加_牛客题霸_牛客网 (nowcoder.com) 示例1 输入 1 2008 2 3 100 输出 2008-05-13 思路一 #include iostream using namespace std;class Date { public:Date(int year 1, int month 1, int day 1,int sky 0){_year year;_month month;_day day;_sky sky;}int GetMonth(int year, int month){int arr[13] { 0,31,28,31,30,31,30,31,31,30,31,30,31 };if (month 2 ((year % 4 0 year % 100 ! 0) || (year % 400 0))){return 29;}return arr[month];}void Calendar(){_day _day _sky;while (_day GetMonth(_year, _month)){_day _day - GetMonth(_year, _month);_month;if (_month 13){_year;_month 1;}}}friend ostream operator(ostream out, Date d);friend istream operator(istream out, Date d);private:int _year;int _month;int _day;int _sky; };ostream operator(ostream out, Date d) {printf(%04d-%02d-%02d, d._year, d._month, d._day);return out; } istream operator(istream in, Date d) {ind._yeard._monthd._dayd._sky;return in; }int main() {int n 0;cinn;while(n--){Date d1;cind1;d1.Calendar();coutd1endl;;}return 0; } // 64 位输出请用 printf(%lld) 本人实力有限可能对一些地方解释和理解的不够清晰可以自己尝试读代码或者评论区指出错误望海涵 感谢大佬们的一键三连 感谢大佬们的一键三连 感谢大佬们的一键三连
http://www.hkea.cn/news/14509811/

相关文章:

  • 无锡做网站365caiyi住房和城乡建设部的叉车证能用吗
  • 做本地网站赚钱吗php可视化网站开发工具
  • 网站设计服务做招聘网站需要哪些手续
  • 设计 微网站个人作品展示网站
  • php网站开发用什么软件百度个人网站申请
  • 有没有专门搞网站上线的公司妇幼医院网站建设方案
  • 七彩建设集团官方网站管理培训公司
  • 自己做网站 如何推广个人风采网站制作
  • 苏州市住房和城乡建设局网站台州市住房和城乡建设厅网站
  • 张槎网站开发大数据网站开发工程师
  • 阳江网站建设推广安微省建设厅网站
  • 给人做传销网站哈尔滨seo优化客户
  • 拖拽式制作网站做网站都需要什么步骤
  • 提供网站建设报价做网站大概需要多少钱
  • 网站设置关键词学历提升专升本
  • 网站重构营销一型网站建设公司
  • 烟台市建设工程交易中心网站网页设计与制作心得体会800字
  • 做教育网站多少钱wordpress首页弹出公告
  • 深圳代做网站网站维护页面怎么做的
  • 重庆 做网站开网店需要自己做网站吗
  • 江苏10大网站建设公司小程序搭建系统
  • 屏山县建设招标网站关键词排名优化怎么样
  • 淘宝客 网站无备案公众号平台官网网页版
  • 有哪些是外国人做的网站中国建筑集团有限公司有几个局
  • 三河网站建设公司百度系app有哪些
  • 网站建设定制价格明细表用照片做的ppt模板下载网站
  • 苏州企业建站公司软件技术跟网站开发有关系吗
  • 重庆网站定制哪家好开车搜索关键词
  • 门户网站开发项目一个专做里番的网站
  • 企业网站后台管理妇科医院网站建设