CodePudding user response:
What a great god help just learn C language primary school brother ahCodePudding user response:
Have a while loop, loop m++, having a variable records to find the number of prime Numbers, exit to five, sum back to or added can be directly to findCodePudding user response:
# include
#include
Int isprime (int num)
{
Int I, rt.
Rt=(int) SQRT (num);
For (I=2; iIf (num % I==0)
return 0;
return 1;
}
Int main ()
{
int m, n;
Int CNT=0, TMP, I;
The scanf (" % d % d ", & amp; M, & amp; N);
If (m & gt; N) {
TMP=m;
M=n;
N=TMP;
}
For (I=m; i <=n; I++) {
{if (isprime (I))
Printf (" % d \ t ", I);
Cnt++;
If (% CNT==0, 10)
Putchar (10);
}
}
return 0;
}
On the basis of the change
CodePudding user response:
Because the bigger the sparse of prime number 2 billion is close to a maximum of int (32-bit), therefore, should use unsigned int, or 64 - bit machine with int,CodePudding user response:
In essence is how to find prime NumbersCodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html