fork(7) download
  1. #include<stdio.h>
  2. #define max 100001
  3.  
  4. int arr[max];
  5. void genprime()
  6. {
  7. int i,j;
  8. for(i=2;i<max;i++)
  9. {
  10. if(arr[i]==0)
  11. {
  12. for(j=i*2;j<max;j+=i)
  13. {
  14. arr[j]=1;
  15. }
  16. }
  17. }
  18. }
  19.  
  20. int main()
  21. {
  22. genprime();
  23. /*put your code here*/
  24. return 0;
  25. }
Success #stdin #stdout 0s 3280KB
stdin
Standard input is empty
stdout
Standard output is empty