Blue Bridge cup basic exercise leap year judgment [basic questions], Blue Bridge leap year

Source: Internet
Author: User

Blue Bridge cup basic exercise leap year judgment [basic questions], Blue Bridge leap year
Basic exercise leap-year Judgment time limit: 1.0 s memory limit: 256.0 MBProblem description

For a given year, determine whether the year is a leap year.

This year is a leap year when one of the following conditions is met:

1. The year is a multiple of 4 rather than a multiple of 100;

2. The year is a multiple of 400.

Other years are not leap years.

The input format contains an integer y, indicating the current year. Output Format outputs a row. If the given year is a leap year, yes is output; otherwise, no is output.

Note: When you specify to output a string as the result (for example, if you select yes or no in this question, you must strictly follow the case given in the question. If you enter an incorrect case, no score is obtained.

Sample input 2013 sample output no sample input 2016 sample output yes data size and Convention 1990 <= y <= 2050.

 

 

# Include <stdio. h> int main () {int y; while (~ Scanf ("% d", & y) {if (y % 4 = 0 & y % 100! = 0 | y % 400 = 0) printf ("yes \ n"); elseprintf ("no \ n");} return 0 ;}


 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.