for循环:
#include <stdio.h>
int main()
{
int i;
for ( i = 0; i <=1000; i++)
{
if (i%21==0)
{
printf("%d,",i);
}
}
return 0;
}
while循环:
#include <stdio.h>
int main()
{
int a = 1;
while (a <= 1000)
{
if (a % 21 == 0) {
printf("%d ", a);
}
a++;
}
return 0;
}