|
|
back to boardWhy I always get crash!!!!!!!!!!!! Posted by kkk 15 May 2002 19:19 Here is my resources #include<stdio.h> #include<math.h> main() { long a[15000],i,j,sum; int state,n,k; a[0]=2; a[1]=3; sum=1; for(i=5;i<170000,sum<15000;i++) { for(j=2;j<=sqrt(i);j++) { state=1; if(i%j==0) { state=0; break; } } if(state) { sum++; a[sum]=i; } } scanf("%d",&n); for(i=0;i<n-1;i++) { scanf("%d",&k); printf("%ld\n",a[k]); } scanf("%d",&k); printf("%d",a[k-1]); } Thank you if anyone who can help me!!! |
|
|