fork download
  1. int shanks(int a, int p){
  2. if(legendre(a, p) != 1)
  3. return 0;
  4. else if a == 0
  5. return 0;
  6. else if p == 2
  7. return p;
  8. else if(p % 4 == 3)
  9. return modpow(a, (p + 1) / 4, p);
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int shanks(int, int)':
prog.cpp:2:21: error: 'legendre' was not declared in this scope
     if(legendre(a, p) != 1)
                     ^
prog.cpp:4:13: error: expected '(' before 'a'
     else if a == 0
             ^
prog.cpp:6:5: error: 'else' without a previous 'if'
     else if p == 2
     ^
prog.cpp:6:13: error: expected '(' before 'p'
     else if p == 2
             ^
prog.cpp:8:5: error: 'else' without a previous 'if'
     else if(p % 4 == 3)
     ^
prog.cpp:9:40: error: 'modpow' was not declared in this scope
         return modpow(a, (p + 1) / 4, p);
                                        ^
stdout
Standard output is empty