才求闰年的,我这个程序哪里写错了
#include <stdio.h>void main()
{
int a,year;
printf("please input a year: ");
scanf("%d\n",&a);
if (a % 400 == 0)
{
1==year;
printf("%d is a year\n",a);
}
else
{
0==year;
printf("%d is no leap year!\n",a);
}
}
if (a % 400 == 0) 改if(a%400==0||a%4==0&&a%100!=0) 1==year;和0==year;改year=1;和year=0; 多谢,都是好人呀 if (a % 400 == 0) 改if(a%400==0||a%4==0&&a%100!=0) 1==year;和0==year;改year=1;和year=0;
页:
[1]