main()
{
int i,count,sum;
for(i=1,count=0,sum=0;i<100;i++)
if(i%3==0||i%13==0)
{
printf("%d",i);
if(++count%5==0)printf("\n");
else printf("\t");
sum+=i;
}
printf("\n共 %d 个数字,和为 %d 。\n",count,sum);
}
#include
void main() { int i,n,s;
for ( n=s=0,i=1;i<100;i+=2 )
if ( i%3==0 || i%13==0 ) {
printf("%d ",i); s+=i; n++; if ( n%5==4 ) printf("\n");
}
printf("\n%d\n",s);
}
#include
int main()
{
int i, j = 0, sum = 0;
for(i=0; i<101; i++)
{
if(i%3 == 0 || i%13 == 0)
{
printf("%d ",i);
j++;
sum += i;
}
if(j == 5)
{
j = 0;
printf("\n");
}
}
printf("\n");
printf("sum = %d\n", sum);
return 0;
}