How to write code to achieve date effect
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.