闰年
Time Limit: 1000MS Memory Limit: 32768KB
Problem Description
时间过得真快啊,又要过年了,同时,我们的人生也增长了一年的阅历,又成熟了一些。可是,你注意过今年是不是闰年呢,明年呢?
以上是闰年的计算方法的流程图,聪明的你能否通过编程计算任意给出的一个年份是否是闰年呢?相信这个问题你能很快解决掉。
Input
只有一个整数year,代表年份。
Output
如果是闰年输出Yes,否则输出No。
Example Input
2000
Example Output
Yes
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d;
scanf("%d",&a);
b = a % 4;
c = a % 100;
d = a %400;
if(b == 0){
if(c != 0){printf("Yes");}
else{
if(d == 0){printf("Yes");}
else{printf("No");}}}
else{
printf("No");
}
return 0;
}