- 애들 시키려고 만들었음
 
- printf가 좀더 빠르다.
 
~cpp 
#include <stdio.h>
#include <cmath> 
#include <ctime> 
bool IsPrime(int n) 
{ 
	for(int j = 3 ; j <= sqrt(n) ; j+=2) 
	{ 
		if(n % j == 0) 
			return false; 
	} 
	return true; 
} 
int main() 
{ 
	printf("%d %d",2,3); 
	for(int i = 5 ; i <= 50000 ; i+=2) 
	{ 
		if(i % 3 == 0) 
			continue; 
		else if(IsPrime(i)) 
			printf("%d ",i); 
	}        
	return 0; 
}
----
소수구하기













