作业3-4 判断是不是闰年

/*判断是不是闰年*/
#include<stdio.h>
int main(void)
{
    int i,n,year;
    printf("Enter n:");/*输入提示*/
    scanf("%d",&n);
    for(i=1;i<=n;i++){/*开始for语句的循环*/
        printf("Enter year:");/*输入提示*/
        scanf("%d",&year);
        if((year%4==0&&year%100!=0)||(year%400==0)){/*判断是不是闰年*/
            printf("这是闰年");
        }
        else{
            printf("这不是闰年");
        }
    }


        return 0;

    }

 

 
原文地址:https://www.cnblogs.com/shenyunwen/p/3378319.html