c语言代码(闰年)

#include
#include
int main()
{
   int year;
   int leap;
   printf("please enter year:");
   scanf("%d",&year);
   if((year%4==0&&year%100!=0)||(year%400==0))
    leap=1;
   else
    leap=0;
   if (leap==1)
    printf("%d is a leap\n",year);
   else
    printf("%d is not a leap\n",year);
       system("pause");
   return 0;
}
  

你可能感兴趣的:(c语言代码(闰年))