输出21世纪所有的闰年.判断闰年的条件是:能被4整除但不能被100整除,或者能被400整除.并按4个年份一组
输出21世纪所有的闰年.判断闰年的条件是:能被4整除但不能被100整除,或者能被400整除.并按4个年份一组
private sub command1_click()
dim i as integer ,k as integer
for i =2000 to 2999
if (i mod 4=0 and i mod 100 0 ) or (i mod 400=0 ) then
print i ;
k =k +1
end
if k mod 4=0 then print
next i
end sub
太多了,用vb编程
private sub command1_click()
dim i as integer ,k as integer
for i =2000 to 2999
if (i mod 4=0 and i mod 100 0 ) or (i mod 400=0 ) then
print i ;
k =k +1
end
if k mod 4=0 then print
next i
end sub
我用C编的,用wintc试验成功.将21世纪设为2000到2099
#include "stdio.h"
#include "conio.h"
main()
{int z;
int i=0,j,n=0,lead;
printf("plesae enter the century,eg:21\n");
scanf("%d",&z);j=(z-1)*100;
for(;i