希杰烘焙是什么连锁:判别2000到2500年中哪些为闰年

来源:百度文库 编辑:高校问答 时间:2024/05/02 20:13:11
已知闰年的判别条件为:1)、年份能被4整除但不能被100整除2)、年份能被100整除又能被400整除
编程:判别2000到2500年中哪些为闰年
用VF编写,最好有编写思路,谢谢!

主要语句如下

integer year;
DO year=2000,2500,1
if ( (year % 4 .EQ. 0) .AND. (year % 100 .NE. 0) .OR. (year % 400 .EQ. 0) then
write(*,*) year
end if
end DO

clea
for a=2000 to 2500
if int(a/100)=a/100
if int(a/400)=a/400
??a
endi
else
if int(a/4)=a/4
??a
endi
endi
endf

闰年有决定,四年一闰,百年不闰,四百年又闰!
按照以上,那么我们首先应该判断,当年年份是否能够被100整除,如果能带除,那么再判断是否能被400整除.
如果不能被100整除,那么再判断是否能被4整除.可以的话就是显示.