题目:
代码:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d",&n);
if(n%4==0 && n%100!=0 || n%400==0)
{
printf("yes\n");
}
else
{
printf("no\n");
}
return 0;
}
解析:
1、闰年的判断条件为能被4整除且不能被100整除或者能被400整除。
2、运用逻辑表达式可以理清逻辑关系。