|
Анхний тоог олох.
| 03.31.2011, 9:27 AM |
Массиваар шийдэв.
#include<iostream> #include<cmath> #define DIGIT 10000 using namespace std; int A[DIGIT]; int main() { int M=1,N; cin>>N;
A[1]=2; for(int i=3;i<=N;i++) { for(int j=1;j<=M&&sqrt(i)>=A[j];j++) if(i%A[j]==0) goto Next; cout<<A[M]<<" "; M++; A[M]=i; Next:; } system("PAUSE"); }
|
Category: My files | Added by: Bemby
|
Views: 757 | Downloads: 0
| Comments: 2
| Rating: 0.0/0 |
Total comments: 2 | |
0 2
Uka_09 (04.06.2011 8:54 AM)
[ Entry]
Sn bn shu amjilt husye. :D
|
0 1
byambaa (03.31.2011 5:59 PM)
[ Entry]
sain bna and
|
|
|
Дархан хот 2024 он |
|
|
|