Traditional Culture Encyclopedia - The 24 Solar Terms - How does C language judge leap year and leap year judgment conditions?
How does C language judge leap year and leap year judgment conditions?
2. then Cout
3、? CIN & gt; & gt year; The input data is saved in a year integer variable.
4. If (year < = 0) judges whether the year variable is less than or equal to 0, the year has no negative number. Illegal input exits the program.
5. Then enter if ((year% 4 = = 0&; & amp Year% 100! = 0)| | year % 400 = = 0)cout & lt; & lt Year & lt& lt "Year is a leap year" < & ltendlelsecout & lt& lt "Year is an average year" < & ltendl How to judge whether a year is a leap year or not?
6. Return 0; Return the value to main () and end the program, as shown in the figure below.
- Related articles
- What is Xiaoman: What are the origins and customs of solar terms?
- Does the winter solstice mean entering nine o'clock?
- What is the classic aesthetic mood of the Spring Festival background picture?
The Spring Festival is a new beginning of the year. Every spring festival is the time for us to go to the old and we
- What is the great cold solar term for?
- Ancient poems about eating moon cakes
- The power of habit
- In China, there is a saying that "seeing summer in the long summer" refers to the ant manor in the long summer season.
- How do company leaders celebrate their father's 60th birthday with gifts?
- How to recuperate qi deficiency and blood deficiency
- Red porcelain taoyi