Home  >  Article  >  Backend Development  >  A detailed introduction to the leap year judgment code

A detailed introduction to the leap year judgment code

巴扎黑
巴扎黑Original
2017-06-11 17:43:304236browse

This article mainly introduces the relevant information about leap year judgment in java interview questions. Friends who need it can refer to the preface of java leap year judgment: Given a year, determine whether this year is a leap year. A year is a leap year when one of the following conditions is met: 1. The year is a multiple of 4 instead of 100; 2. The year is a multiple of 400. All other years are not leap years. Input format The input contains an integer y, representing the current year. The output format outputs one line. If the given year is a leap year, it will output yes, otherwise it will output no. Note: When the test question specifies that you output a string as the result (such as yes or no in this question, you need to strictly follow the case given in the test question. If you write the wrong case, you will not get points. Sample input 2013 sample output no sample Input 2016 sample output yes data size and convention 1990 <= y <= 2050. ​ public class Main {

1. java Detailed explanation of the sample code for leap year judgment

A detailed introduction to the leap year judgment code

Introduction: This article mainly introduces relevant information on leap year judgment in Java interview questions. Friends who need it can refer to

2. Questions about the date function z parameter and leap year

Introduction: Regarding the question about the z parameter of the date function and the leap year, I have previously written code about whether it is a leap year. A leap year has 366 days. When I used the date function today, I saw that there was a parameter 'z' (outputting the day of the year), so I used date to write a simple leap year judgment. The code is as follows /*** Output whether the given year is a leap year * @param string $year*/function printYear($yea

3. Questions about the z parameter of the date function and leap year

Introduction: About the z parameter of the date function and leap year I have written a code about whether it is a leap year before. There are 366 days in a leap year. When I used the date function today, I saw that there was a parameter 'z' (outputting the day of the year), so I used date to write a simple leap year. Judgment, the code is as follows/*** Output whether the given year is a leap year * @param string $year*/function printYear($yea

4. Oracle Leap Year Judgment

Introduction: //The most direct judgment of a leap year is: a year that is divisible by 4 and not divisible by 100, or a year that is divisible by 400 create or replace procedure pro_leap_year(year_in


The above is the detailed content of A detailed introduction to the leap year judgment code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn