=i是起什么作用?{count++; printf(count%15?"%5d":"\n%5d",i);}}return" /> =i是起什么作用?{count++; printf(count%15?"%5d":"\n%5d",i);}}return - 作业答案大全" />

函数fun()的功能是:统计所有小于等于n的素数的个数,素数的个数作为函数值返回.这段程序是怎么达到目的#include int fun(int n){int i,j,count=0;printf("\nThe prime number between 3 to %d\n",n);for (i=3; i=i){count++; printf(count%15?"%5d":"\n%5d",i);}}return count;}main(){int n=20,r;r = fun(n);printf("\nThe number of prime is :%d\n",r);}#include int fun(int n){int i,j,count=0;printf("\nThe prime number between 3 to %d\n",n);for (i=3; i=i) 这里j>=i是起什么作用?{count++; printf(count%15?"%5d":"\n%5d",i);}}return

问题描述:

函数fun()的功能是:统计所有小于等于n的素数的个数,素数的个数作为函数值返回.这段程序是怎么达到目的
#include
int fun(int n)
{int i,j,count=0;
printf("\nThe prime number between 3 to %d\n",n);
for (i=3; i=i)
{count++; printf(count%15?"%5d":"\n%5d",i);}
}
return count;
}
main()
{int n=20,r;
r = fun(n);
printf("\nThe number of prime is :%d\n",r);
}
#include
int fun(int n)
{int i,j,count=0;
printf("\nThe prime number between 3 to %d\n",n);
for (i=3; i=i) 这里j>=i是起什么作用?
{count++; printf(count%15?"%5d":"\n%5d",i);}
}
return count;
}
main()
{int n=20,r;
r = fun(n);
printf("\nThe number of prime is :%d\n",r);
}

if (i%j == 0)break; 这句用break是什么意思?如果i被j整除.即i除以j而没有余数,说明不是质数,而是合数.所以用break跳出 for (j=2; j=i) 这里j>=i是起什么作用?说明从2到j都没有能够整除i,所以是质数啊,就加一了.你理...