Pagini recente » Cod sursa (job #1831385) | Cod sursa (job #231327) | Cod sursa (job #376020) | Cod sursa (job #857434) | Cod sursa (job #2032148)
#include<cstdio>
#include<algorithm>
using namespace std;
bool cresc;
int main()
{
FILE* in = fopen("lgput.in", "r"); ///probleme
FILE* out = fopen("lgput.out", "w");
int a, b, p = 1;
fscanf(in, "%d%d", &a, &b);
while(b > 0)
{
if(b % 2 == 1)
{
p *= a;
a = a * a;
b--;
b /= 2;
}
else
{
a = a * a;
b /= 2;
}
}
int r = p % 1999999973;
fprintf(out, "%d", p);
}