作业3(4)

#include<stdio.h>
int main(void)
{
    int year;
    printf("Enter The year:");/*输出*/
    scanf("%d",&year);/*从键盘输入*/
    while(year!=-1){
        if((year%4==0&&year%100!=0)||(year输出这一年是闰年*/%400==0)){/*判断当这个数字能被4整除且不能被100整除或者能被400整除*/
            printf("The year is 闰年
");/
            printf("Enter The year:");
            scanf("%d",&year);
        }
        else{/*判断*/
            printf("The year is not 闰年
");
            printf("Enter The year:");
            scanf("%d",&year);/*从键盘输入年*/
        }
    }
    

return 0; }

原文地址:https://www.cnblogs.com/chaoyue0806/p/3378445.html