判断这一年是否是闰年?
# include <stdio.h>int main()
{
int a;
char L,N;
scanf("%d",&a);
if(a%4==0)
{
if(a%100==0)
{
if(a%400==0) printf("%c\n",L);
else printf("%c\n",N);
}
else printf("%c\n",L);
}
else printf("%c\n",N);
return 0;
}
为什么我得到的答案总是一个?
# include <stdio.h> int main() { int a; //char L,N; scanf("%d",&a); if(a%4==0) { if(a%100==0) { if(a%400==0) printf("L\n");//("%c\n",L); else printf("N\n");//("%c\n",N); } else printf("L\n");//("%c\n",L); } else printf("N\n");//("%c\n",N); return 0; }