Rezolvarea in c++ as dori !

#include <iostream>
#include <cmath>
using namespace std;
int putere(int a, int b, int c){
int apowb;
if(b % 2 == 0){
apowb = pow(a, b/2) * pow(a, b/2);
} else if (b % 2 != 0){
apowb = a * pow(a, b-1);
}
return (apowb % c);
}
int main()
{
cout << putere(3, 6, 100) << endl;
}