Pagini recente » Cod sursa (job #891700) | Cod sursa (job #491602) | Cod sursa (job #2261820) | Cod sursa (job #2120598) | Cod sursa (job #1268315)
#include<fstream>
using namespace std;
int a, b;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int putere(int a, int b){
if(b == 0){
return 1;
}
else{
int x = putere(a, b / 2);
if(b % 2 == 0){
return (long long) x * x % 1999999973;
}
else{
return (long long) x * x % 1999999973 * a % 1999999973;
}
}
}
int main(){
fin>> a >> b;
fout<< putere(a, b);
return 0;
}