Title / Description
Code #include <stdlib.h> #include <stdio.h> #define N 10000 void main(int argc, char *argv){ int i, j, a[N]; for(i = 2; i < N; i++) a[i] = 1; for(i = 2; i < N; i++) if(a[i]) for(j = i; i * j < N; j++) a[i * j] = 0; for(i = 2; i < N; i++) if(a[i]) printf("%4d", i); printf("\n"); }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code