一、运行结果;
二、源代码;
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>
int main()
{
//初始化变量值;
int year = 2000;
//执行循环判断;
while (year <= 2010)
{
//执行流程;
//判断能否整除4;
if (year % 4 == 0)
{
//判断能否整除100;
if (year % 100)
{
//打印结果;
printf("%d是闰年!\n", year);
}
}
else
{
//打印结果;
printf("%d不是闰年!\n", year);
}
//改变数值;
year++;
}
return 0;
}
三、流程图;