U E D R , A S I H C RSS

소수구하기/재니

02 Genie

~cpp 
#include <iostream.h>
#include <ctime>

int main()
{
	clock_t start = clock();
	int premium[5133], count = 0;
	premium[0] = 2;
	cout << "2\n";
	for (int i = 3 ; i <= 50000 ; ++++i)
		for (int j = 0 ; j <= count ; j++)
		{
			if (i % premium[j] == 0)	break;
			if (premium[j] > i / 3)
			{
				count++;
				premium[count] = i;
				cout << premium[count] << ' ';
				break;
			}
		}
	clock_t end = clock() - start;
	cout << (double)end/CLOCKS_PER_SEC << "\n";
	return 0;
}

..

iostream.h

iostream ....

?^^

....... .. 0.9 ...

형~~ _____

----

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:13
Processing time 0.0129 sec