20151017判断闰年的最简洁算法

#include <stdio.h>
#include <Windows.h>
int main() 
{
    int year; 
    printf("请输入年份:");
    scanf("%d",&year);
    if((year%4==0&&year%100!=0)||year%400==0)
    {
        printf("%s\n","这一年是闰年");
    }
    else
    {
        printf("%s\n","这一年是平年");
    }
    system("pause"); 
    return 0;   
}

posted on 2017-10-05 18:17  sunshineman1986  阅读(92)  评论(0编辑  收藏  举报

导航