fork download
  1. #include <stdio.h>
  2. int main (void)
  3. {
  4. int a[9592], i, j, n = 2, u;
  5. a[0] = 2, a[1] = 3;
  6. for (i = 4; i <= 100000; ++i)
  7. {
  8. u = 0;
  9. for (j = i / 2; j > 1; --j)
  10. {
  11. if (i % j == 0)
  12. {
  13. a[n] = -1;
  14. n = n + 1;
  15. break;
  16. }
  17. else
  18. {
  19. u = u + 1;
  20. }
  21. }
  22. if (u == (i / 2) - 1)
  23. {
  24. a[n] = i;
  25. n = n + 1;
  26. }
  27. }
  28. for (i = 0; i < 9592; ++i)
  29. {
  30. if (a[i] != -1)
  31. printf ("%d\n", a[i]);
  32. }
  33. return 0;
  34. }
Runtime error #stdin #stdout 0.17s 2244KB
stdin
Standard input is empty
stdout
Standard output is empty