1098 through an exam to find a large prime number

#include <the iostream>
#include <cstdio>
#include <the cmath>
the using namespace STD;
int main ()
{
Long Long I int, n-;
CIN n->>;
for (I = 2; I <= sqrt (n-); i ++) // I had written: for (i = n-1 ; i> = sqrt (n); i--), this idea is more intuitive, direct to find large numbers. But this time out. For example, a large number, may cut down's powers, I could not find the number. But if, in turn, grew up to find, so it is simple more, because of the smaller number in a certain range the more multiples to find the minimum number.
{
IF (n-I% == 0)
{
COUT n-<< / I; // divided by the smallest prime number to obtain the maximum prime number.
0 return;
}
}
return 0;
}

Guess you like

Origin www.cnblogs.com/57xmz/p/12239438.html