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);
^