Pagini recente » Cod sursa (job #2832982) | Cod sursa (job #2435256) | Cod sursa (job #1923086) | Cod sursa (job #2132163) | Cod sursa (job #2273495)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int putere(int x, int put)
{
if(put==0)
return 1;
else if(put%2==0)
{
int y=putere(x,put/2);
y=y%1999999973;
return (y*y)%1999999973;
}
else
return (putere(x,put-1)*x)%1999999973;
}
int main()
{
int a,b;
fin>>a>>b;
fout<<putere(a,b);
return 0;
}