// prime #s - Goldbach's Conjecture !!!!!! DONE !!!!!!! #include #include #define MAX 20000 char prim[MAX]; void main() { // set-up table memset(prim, '*', sizeof(prim) ); for (long i=2; i < MAX; i++) if (prim[i] == '*') for (long j=2*i; j < MAX; j += i) prim[j] = 0; ofstream out; out.open("gold.out"); ifstream in; in.open("gold.in"); while (1) { int n; in >> n; if (n < 0) break; for (int a=1; a <= n/2; a++) if (prim[a] == '*' && prim[n-a] == '*') out << a << " " << n-a << endl; out << endl; //cout << "Done" << endl; } in.close(); out.close(); /*** speed test for (int BIG=0; BIG < 100; BIG++) { for (int a=2; a <= n-2; a++) if (prim[a] == '*' && prim[n-a] == '*') {}; //cout << a << " " << n-a << endl; } ****/ } Downloader failed! Response object 006~ASP 0159~Buffering Off~Buffering must be on.