zsj1337455772 @ 2024-12-03 18:11:43
#include<stdio.h>
void find(int a,int b,int c)
{
int i,h[10000],z=0,j;
for(i=a;i<b;i++)
{
if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
{
h[z]=i;
z++;
c++;
}
}
printf("%d\n",c);
for(j=0;j<=c-1;j++)
{
printf("%d ",h[j]);
}
}
int main()
{
int a,b,i,sum=0;
scanf("%d %d",&a,&b);
find(a,b,sum);
return 0;
}
by programmer330 @ 2024-12-03 18:20:10
@zsj1337455772
第
AC求关
#include<stdio.h>
void find(int a,int b,int c)
{
int i,h[10000],z=0,j;
for(i=a;i<=b;i++)
{
if((i % 4 == 0 && i % 100 != 0)||(i % 400 == 0))
{
h[z]=i;
z++;
c++;
}
}
printf("%d\n",c);
for(j=0;j<=c-1;j++)
{
printf("%d ",h[j]);
}
}
int main()
{
int a,b,i,sum=0;
scanf("%d %d",&a,&b);
find(a,b,sum);
return 0;
}
by zsj1337455772 @ 2024-12-04 00:16:50
@programmer330谢谢