flag咋回事,一下是0,一下是1
#include"stdio.h"int main()
{
int year, i, flag=0;
scanf("%d", &year);
if(year <= 2000 || year >= 2101)
{
printf("Invalid year!");
}
else
{
for(i = 2001;i <= year;i++)
{
if((i%4 == 0 && i%100 != 0) || (i%400 == 0))
{
flag = 1;
printf("%d\n", i);
}
}
if(flag == 0)
{
printf("None");
}
}
return 0;
}