Pagini recente » Cod sursa (job #302542) | Cod sursa (job #268046) | Cod sursa (job #362419) | Cod sursa (job #2924626) | Cod sursa (job #274610)
Cod sursa(job #274610)
#include <stdio.h>
#define Mod 1999999973
int a,b;
int power(int a, int b)
{
int x;
if (b==1) return a;
else
if (b%2==0)
{
x=power(a,b/2);
return (x*x)%Mod;
}
else
{
x=power(a,b/2);
return (((x*x)%Mod)*a)%Mod;
}
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%d %d", &a,&b);
printf("%d", power(a,b));
return 0;
}