#include
#include <
Vector>
#include
Using
Namespace
STD;
Int main
Int Argc,
Char * argv []) {
IF (argc! = 2) {
CERR <<
"USAGE: / N / T" << argv [0] <<
"
Return 1;
}
INT count = 0;
//Calculate
unsigned
INT MAXNUM = ATOI (Argv [1]);
Vector <
unsigned
int> primelist;
Vector <
unsigned
Int> :: item N;
// Vector internal pointer
Primelist.push_back (2);
// Put 2
unsigned
INT A = 2;
FOR (; a <0xffffffffffffff; A ) {
unsigned
INT B = SQRT (a);
// Compare the opening value to determine
For (n = primelist.begin (); 1; n ) {
// Traverse the number of pixels
IF (* n> b)
Break;
IF ((a% * n) == 0)
Goto endfor;
}
Primelist.push_back (a);
IF (a <= maxnum) {
COUNT ;
Cout << a <<
""
}
Else
Break;
ENDFOR :;
}
COUT << Endl << count << Endl <<
"* End *" << ENDL;
Return 0;
}