No older revisions available
No older revisions available
~cpp #include<iostream> #include <ctime> using namespace std; int main() { clock_t t1 = clock();//시간재기위한라인 int i; int j; int count; for(i=2;i<50000;i++){ count=0; for(j=2;j<i;j++){ if(i%j==0) { count++; break; } } if(count==0) cout<<i<<"\n"; } clock_t t = clock() - t1;//시간재기위한라인 cout << (double)(t/CLOCKS_PER_SEC) << "\n"; return 0; }