主题:求闰年的程序,,怎么错了呀
#include<stdio.h>
void main()
{
int year,leap;
scanf("%d",&year);
if(year%4==0)
{
if(year%100==0)
{
if(year%400==0)
leap=1;
else
leap=0;
}
else
leap=1;
}
else
leap=0;
if(leap=0)
{
printf("%d is a not leap year\n");
}
else
printf("%d is a leap year\n");
void main()
{
int year,leap;
scanf("%d",&year);
if(year%4==0)
{
if(year%100==0)
{
if(year%400==0)
leap=1;
else
leap=0;
}
else
leap=1;
}
else
leap=0;
if(leap=0)
{
printf("%d is a not leap year\n");
}
else
printf("%d is a leap year\n");