// ---------------------------------------------------------------------- // // Module: jacobi.cc // Description: compute jacobi symbols // Contributed by: Rene Peralta // Date: 1999 // // ---------------------------------------------------------------------- #include #include int main( int argc, char *argv[ ] ) { ln n,x; cout << " 0 to exit any loop " << endl; while(1) { cout << "enter modulus : " ; cin >> n ; if (n == 0) return(0); while (1) { cout << "x " ; cin >> x ; if (x == 0) break; x = x % n; cout << " " << Jacobi(x,n) << endl << endl; } } return 0; }