Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write code to achieve date effect

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to write code to achieve date effect". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn "how to write code to achieve date effect".

The usage of printf "d", 02: less than two digits to make up 0

# include#include#include#includeusing namespace std;int days [13] = {0int leap=year0&&year%4==0 31month==2 2831jort 31jort 31jort 31jiggle 31jort 31jort 31pjort 31page31}; bool check_date (int year,int month,int day) {if (month==0 | | month > 12) return false; if (day==0 | | monthically qualified people's day > days [month]) return false; if (month==2) {int leap=year0&&year%4==0 | | year%400==0; if (day > 28+leap) return false;} return true;} int main () {int Scanf ("% d/%d/%d", & int for 19600101); / / enumerates eight-digit for between January 1, 1960 and December 31, 2059.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report