手记

判断年份是否是闰年

#include <stdio.h>

int main() 

{

    int year = 2014; //今年是2014年

    if(year%4==0&&year%100!=0||year%400==0)

    {

        printf("%s\n","今年是闰年");

    }

    else

    {

        printf("%s\n","今年是平年");

    }

    return 0;

}


2人推荐
随时随地看视频
慕课网APP