闰年

Time Limit: 1000 ms Memory Limit: 32768 KiB

Submit Statistic

Problem Description

时间过得真快啊,又要过年了,同时,我们的人生也增长了一年的阅历,又成熟了一些。可是,你注意过今年是不是闰年呢,明年呢?

sdut oj C语言 闰年

以上是闰年的计算方法的流程图,聪明的你能否通过编程计算任意给出的一个年份是否是闰年呢?相信这个问题你能很快解决掉。

 

Input

只有一个整数year,代表年份。

Output

如果是闰年输出Yes,否则输出No。

Sample Input

2000

Sample Output

Yes
#include <stdio.h>
int main()
{
    int year;
    scanf("%d", &year);
    if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-09-13
  • 2021-09-20
  • 2021-10-25
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-29
  • 2021-04-03
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案