Hey! What's wrong with this c++ code?
#include <iostream>
using namespace std;
int f(int x, long int y) {
if (y==0){
return 1;
}
if(y%2==0){
return f(x,y/2)**2 % 41;
}
if (y%2==1){
return x*f(x,y/2)**2 % 41;
Read more… (52 words)
Hey! What's wrong with this c++ code?
#include <iostream>
using namespace std;
int f(int x, long int y) {
if (y==0){
return 1;
}
if(y%2==0){
return f(x,y/2)**2 % 41;
}
if (y%2==1){
return x*f(x,y/2)**2 % 41;