if(r)中的r值为什么是1
#include<stdio.h>#define MAX 20
main()
{
int i,j,n,p,r,primes[MAX];
int *pntw, *pntr;
long q;
pntw = primes;
n = 2;
*pntw++ =2;
*pntw++ =3;
i = 5;
do
{
pntr = primes;
do{
p = *pntr++;
q = i/p;
r = i - q * p;
printf("p=%d\tq=%d\tr=%d\n",p,q,r);
}while(r && i < q * q );
printf("r=%d\n",r);
if(r)
{
*pntw++ =i;
n++;
printf("n=%d\tr=%d\n",n,r);
}
i+=2;
getch();
}while (n < MAX);
j=0;
pntr = primes;
for ( i=0;i<MAX;++i )
{
printf("%4d",*pntr++ );
if ( ++j == 10 )
{
printf("\n");
j=0;
}
}
}