1121:0 starting point algorithm 28--judging whether leap year

Source: Internet
Author: User

1121:0 start-up algorithm 28--determine if leap year time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:3988 accepted:2204
[Submit] [Status] [Web Board] Description

Enter the year to determine if the leap years

Input

Enter an integer n (multiple sets of data)

Output

If it is a leap year, output Yes, otherwise output no (one row per group of data)

Sample Input
2000

Sample Output
Yes

Source

0 Starting point Learning algorithm

1#include <stdio.h>2 intMain () {3     intN;4      while(SCANF ("%d", &n)! =EOF) {5         if(((n%4==0) && (n% -!=0))|| (n% -==0))6printf"yes\n");7         Else8printf"no\n");9     }Ten     return 0; One}

Leap years are 1. Divisible by 4 cannot be divisible by 100 by 2. Year that can be divisible by 400.

When judging, pay attention to divisible by% not/

1121:0 starting point algorithm 28--judging whether leap year

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.