1 부터 50000까지 소수 구하기..
~cpp
#include <iostream>
using namespace std;
#include <ctime>
void main()
{
clock_t start = clock();
int counter = 0;
for(int i = 1; i <= 50000; i++)
{
counter=0;
for (int j = 1; j <= i; j++)
{
if(i%j == 0)
counter++;
}
if (counter == 2)
cout << i << "\n";
}
clock_t end = clock() - start;
cout << (double)end/CLOCKS_PER_SEC << "초\n";
} 68.77 초라니........ 절망........
영동이의 도움으로 겨우겨우 짤수 있었다는..... ㅠ_ㅠ
-_-;; 시간은 못 줄이겠고.... 암튼. 엄청느리게 출력되는 허접한 소스.. -_-;










