In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to use C++ to achieve a simple perpetual calendar", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "how to use C++ to achieve a simple perpetual calendar"!
The code is as follows:
/ * * File name: perpetual Calendar .cpp * author: chenghan* completion date: 2019 Universe 10 * version number: 1.0 * problem description: making a simple perpetual calendar * / # include#include using namespace std;// to determine whether a year is a leap year, whether to return true or not to return falsebool isleapyear (int year); / / Rabbit pattern void Rabbit () / / Encapsulation time private data members include year, month and day class Date {private: int year, month, day; / / Private data member public: Date () {} / / No parameter constructor Date (int year, int month, int day); / / parameter constructor void Disp_Date (); / / display week void set (); / / user input time int week () / / function to determine the day of the week void show (); / function to display the calendar}; / / main function int main () {Date t; / / create a Date class object string N = "yes"; Rabbit (); while (naming = "yes") {t.set (); / / call the set time function t.Disp_Date (); / / display the day of the week (); / / display the calendar screen coutN } return 0;} / / to determine whether a year is a leap year, and whether to return true returns falsebool isleapyear (int year) {if ((year% 4 = = 0 & & year% 100! = 0) | | year% 400 = = 0) return true; else return false;} / / Rabbit pattern void Rabbit () {cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.