判断某年是否闰年的程序
运行结果不对,请高手给看看错在哪儿了!main()
{
int a,year;
printf("请输入一个数字:\n");
scanf("%d",&year);
a==(year%4==0&&year%100!=0)||year%400==0;
if(a!=0)
printf("这一年是闰年!\n");
else
printf("这一年不是闰年!\n");
}
#include <stdio.h> int main (void) { int year; printf ("please a year:"); scanf ("%i",&year); if((year%4==0 && year%100!=0)||year%400==0){ printf ("%i is a leap year!",year); }else{ printf ("%i is not a leap year!",year); } return 0; }