#include<stdio.h>
main()
{
int i=1000,geshu=0;
while(i<=9999)
{
while((i*10+6)%3==0)
{
printf("%d\n",i*10+6);
i++;
geshu++;
}
i++;
}
printf("5位数中能被3整除的个数为:%d",geshu);
main()
{
int i=1000,geshu=0;
while(i<=9999)
{
while((i*10+6)%3==0)
{
printf("%d\n",i*10+6);
i++;
geshu++;
}
i++;
}
printf("5位数中能被3整除的个数为:%d",geshu);
}
一次成功