哪里问题
#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=2;/*为什么这里用2得不到结果*/
}
else
leap=1;
}
else
leap=2;/*为什么这里用2得不到结果*/
if(leap=1)
printf("%d is",year);
if(leap=2)
printf("%d is not",year);
printf("a leap year.\n");
}
好象只有用leap=1和leap=0来当开关呀????
谁帮解答下